diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml index b113db7a3a7a..13064e3d2edf 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml +++ b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.format.ps1xml @@ -2,33 +2,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties#Multiple - - - - - - - + - ActivityLogAlertName - - - ResourceGroupName - - - SubscriptionId + Item @@ -36,21 +24,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertIdentity#Multiple - + + + + + + + - Item + ActivityLogAlertName + + + ResourceGroupName + + + SubscriptionId @@ -58,9 +58,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource#Multiple @@ -92,15 +92,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition#Multiple - - - @@ -111,9 +108,6 @@ - - ContainsAny - Equal @@ -126,15 +120,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition#Multiple - - - @@ -145,9 +136,6 @@ - - ContainsAny - Equal @@ -160,9 +148,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList#Multiple @@ -182,9 +170,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags#Multiple @@ -204,9 +192,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties#Multiple @@ -226,9 +214,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties#Multiple @@ -238,9 +226,6 @@ - - - @@ -251,18 +236,15 @@ Enabled - - Scope - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource#Multiple @@ -288,9 +270,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags#Multiple @@ -310,9 +292,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse#Multiple diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 index 4a5222955b69..dad3fb48a665 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/Az.ActivityLogAlert.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ActivityLogAlert.private.dll' FormatsToProcess = './Az.ActivityLogAlert.format.ps1xml' - FunctionsToExport = 'Get-AzActivityLogAlert', 'New-AzActivityLogAlert', 'New-AzActivityLogAlertActionGroupObject', 'New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject', 'New-AzActivityLogAlertAlertRuleLeafConditionObject', 'Remove-AzActivityLogAlert', 'Update-AzActivityLogAlert', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzActivityLogAlert', 'New-AzActivityLogAlert', 'New-AzActivityLogAlertActionGroupObject', 'New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject', 'New-AzActivityLogAlertAlertRuleLeafConditionObject', 'Remove-AzActivityLogAlert', 'Update-AzActivityLogAlert' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ActivityLogAlert' diff --git a/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs index b27bed753bbc..986e6c2293f4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/ActivityLogAlert.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 - ActivityLogAlert")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] -[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.3")] +[assembly: System.Reflection.AssemblyVersionAttribute("6.0.3")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 index bc04ce1676a7..eaf378a45897 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 @@ -29,7 +29,7 @@ Get-AzActivityLogAlert -ResourceGroupName $rg-name -Name $alert-name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azactivitylogalert #> function Get-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -75,7 +75,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +133,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { List = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List'; List1 = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -174,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/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 index 2065c395fa22..289bb75a27b3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 @@ -30,7 +30,7 @@ $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $an New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,18 +42,18 @@ ACTION : The list of the Action Groups. To construct, see NOTES [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -77,32 +77,30 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. # To construct, see NOTES section for ACTIONGROUP properties and create a hash table. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. # To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -111,32 +109,45 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -186,6 +197,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -206,10 +226,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonString = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { @@ -223,6 +243,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/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 index c2558162f458..9ec958406679 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertActionGroupObject.ps1 @@ -23,7 +23,7 @@ Create an in-memory object for ActionGroup. New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -32,10 +32,10 @@ To create the parameters described below, construct a hash table containing the WEBHOOKPROPERTY : the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertActionGroupObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertactiongroupobject #> function New-AzActivityLogAlertActionGroupObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -47,10 +47,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties] # the dictionary of custom properties to include with the post operation. # These data are appended to the webhook payload. - # To construct, see NOTES section for WEBHOOKPROPERTY properties and create a hash table. ${WebhookProperty} ) @@ -61,6 +60,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -89,6 +91,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/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 index e2398ea252b3..80cf662a567f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject.ps1 @@ -26,28 +26,27 @@ $any=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incide New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. ANYOF : An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleanyoforleafconditionobject #> function New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition[]] # An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - # To construct, see NOTES section for ANYOF properties and create a hash table. ${AnyOf}, [Parameter()] @@ -77,6 +76,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -105,6 +107,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/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 index 7d68a3af4336..c3285c610e5a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlertAlertRuleLeafConditionObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for AlertRuleLeafCondition. New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incidentType -Equal Maintenance .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleleafconditionobject #> function New-AzActivityLogAlertAlertRuleLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -58,6 +58,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -86,6 +89,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/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 index 7f60f31bcf72..cccc27603ef3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -29,7 +29,7 @@ Get-AzActivityLogAlert -ResourceGroupName $rg-name -Name $alert-name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azactivitylogalert #> function Get-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -75,7 +75,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +133,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { List = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_List'; List1 = 'Az.ActivityLogAlert.private\Get-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -174,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) @@ -274,7 +283,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -339,6 +347,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -361,9 +378,7 @@ begin { Delete = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_Delete'; DeleteViaIdentity = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -377,6 +392,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) @@ -436,7 +454,7 @@ $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $an New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -448,18 +466,18 @@ ACTION : The list of the Action Groups. To construct, see NOTES [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -483,32 +501,30 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. # To construct, see NOTES section for ACTIONGROUP properties and create a hash table. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. # To construct, see NOTES section for CONDITIONALLOF properties and create a hash table. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -517,32 +533,45 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -592,6 +621,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -612,10 +650,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; + CreateViaJsonString = 'Az.ActivityLogAlert.custom\New-AzActivityLogAlert'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 { @@ -629,6 +667,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) @@ -681,7 +722,7 @@ Create an in-memory object for ActionGroup. New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -690,10 +731,10 @@ To create the parameters described below, construct a hash table containing the WEBHOOKPROPERTY : the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertActionGroupObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertactiongroupobject #> function New-AzActivityLogAlertActionGroupObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -705,10 +746,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties] # the dictionary of custom properties to include with the post operation. # These data are appended to the webhook payload. - # To construct, see NOTES section for WEBHOOKPROPERTY properties and create a hash table. ${WebhookProperty} ) @@ -719,6 +759,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -747,6 +790,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) @@ -802,28 +848,27 @@ $any=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incide New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. ANYOF : An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleanyoforleafconditionobject #> function New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition[]] # An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - # To construct, see NOTES section for ANYOF properties and create a hash table. ${AnyOf}, [Parameter()] @@ -853,6 +898,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -881,6 +929,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) @@ -933,12 +984,12 @@ Create an in-memory object for AlertRuleLeafCondition. New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incidentType -Equal Maintenance .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzActivityLogAlertAlertRuleLeafConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactivitylogalertalertruleleafconditionobject #> function New-AzActivityLogAlertAlertRuleLeafConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -968,6 +1019,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -996,6 +1050,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) @@ -1054,13 +1111,13 @@ Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ActivityLogAlertName ]: The name of the Activity Log Alert rule. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. @@ -1069,10 +1126,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -1080,6 +1139,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -1087,6 +1148,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -1100,26 +1163,41 @@ param( # 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.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1169,6 +1247,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1189,11 +1276,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonString = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1207,6 +1294,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/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 index cfd13cc100e7..de7b1bc0f9e5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 @@ -71,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -136,6 +135,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { Delete = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_Delete'; DeleteViaIdentity = 'Az.ActivityLogAlert.private\Remove-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -174,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/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 index cd3f4b9fc4fe..a6f0457401c7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 @@ -29,13 +29,13 @@ Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [ActivityLogAlertName ]: The name of the Activity Log Alert rule. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. @@ -44,10 +44,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -55,6 +57,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -62,6 +66,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonString')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -75,26 +81,41 @@ param( # 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.ActivityLogAlert.Category('Body')] [System.Boolean] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -144,6 +165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -164,11 +194,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonString = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.custom\Update-AzActivityLogAlert'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonString', 'UpdateViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -182,6 +212,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/ActivityLogAlert.Autorest/generate-info.json b/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json index ae546df56f8f..290b86f34f0f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json +++ b/generated/Monitor/ActivityLogAlert.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "8b11ea6d-f253-44c4-8fa0-a99b6d6e2f72" + "generate_Id": "f24928e3-4b8d-45f5-9497-b8bcb83c2587" } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs index 6cfed69abb08..6be96ef58afb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/Module.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert"; + 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.ActivityLogAlert"; + 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.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs index ab461b51f47f..9a86dd84311a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/ActivityLogAlert.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert public partial class ActivityLogAlert { - /// Create a new Activity Log Alert rule or update an existing one. + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. @@ -25,10 +25,11 @@ public partial class ActivityLogAlert /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsCreateOrUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -55,15 +56,15 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Create a new Activity Log Alert rule or update an existing one. + /// update a new Activity Log Alert rule or update an existing one. /// /// The Activity Log Alert rule to create or use for the update. /// a delegate that is called when the remote service returns 200 (OK). @@ -72,10 +73,11 @@ public partial class ActivityLogAlert /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -114,111 +116,132 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,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 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new Activity Log Alert rule or update an existing one. + /// + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// The Activity Log Alert rule to create or use for the update. + /// Json string supplied to the ActivityLogAlertsCreateOrUpdate 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.ActivityLogAlert.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 ActivityLogAlertsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string activityLogAlertName, 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Delete an Activity Log Alert rule. + /// update a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ActivityLogAlertsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsDelete(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -236,77 +259,142 @@ public partial class ActivityLogAlert + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ActivityLogAlertsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete an Activity Log Alert rule. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a new Activity Log Alert rule or update an existing one. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", 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.Insights/activityLogAlerts/{activityLogAlertName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/activityLogAlerts/" - + activityLogAlertName + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ActivityLogAlertsCreateOrUpdateWithResult_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.ActivityLogAlert.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 ActivityLogAlertsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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 204 (NoContent). + /// 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. @@ -314,7 +402,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -325,6 +413,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -332,19 +421,19 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -360,17 +449,18 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -380,14 +470,17 @@ public partial class ActivityLogAlert await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get an Activity Log Alert rule. + /// Delete an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -395,7 +488,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsGet(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsDelete(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -417,18 +510,19 @@ public partial class ActivityLogAlert // 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.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get an Activity Log Alert rule. + /// Delete an Activity Log Alert rule. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -436,7 +530,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsGetViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -470,18 +564,19 @@ public partial class ActivityLogAlert // 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.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -489,7 +584,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -500,6 +595,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -507,13 +603,19 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -529,8 +631,8 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -539,7 +641,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsDelete_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -552,9 +654,10 @@ public partial class ActivityLogAlert } } - /// Get a list of all Activity Log Alert rules in a resource group. + /// Get an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. /// 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). @@ -563,7 +666,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsGet(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -575,7 +678,8 @@ public partial class ActivityLogAlert + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -589,11 +693,11 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of all Activity Log Alert rules in a resource group. + /// Get an Activity Log Alert rule. /// /// 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 @@ -603,7 +707,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroupViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsGetViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -611,22 +715,652 @@ public partial class ActivityLogAlert { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", 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.Insights/activityLogAlerts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get an Activity Log Alert rule. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", 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.Insights/activityLogAlerts/{activityLogAlertName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get an Activity Log Alert rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsGetWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsGetWithResult_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.ActivityLogAlert.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 ActivityLogAlertsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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 ActivityLogAlertsGet_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsGet_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(activityLogAlertName),activityLogAlertName); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroup(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroupViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", 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.Insights/activityLogAlerts'"); + } + + // 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.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", 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.Insights/activityLogAlerts'"); + } + + // 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.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a 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.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListByResourceGroupWithResult_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.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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 ActivityLogAlertsListByResourceGroup_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionId(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListBySubscriptionId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionIdViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts'"); + } + + // 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.Insights/activityLogAlerts" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -638,14 +1372,158 @@ public partial class ActivityLogAlert var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ActivityLogAlertsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsListBySubscriptionId_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionIdViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts'"); + } + + // 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.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListBySubscriptionIdWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionIdWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/activityLogAlerts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsListBySubscriptionIdWithResult_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.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionIdWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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). @@ -656,7 +1534,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -667,6 +1545,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -674,13 +1553,13 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -696,38 +1575,41 @@ public partial class ActivityLogAlert } /// - /// Validation method for method. Call this like the actual call, but + /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); } } - /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// Parameters supplied to the 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.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionId(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -737,7 +1619,10 @@ public partial class ActivityLogAlert var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -746,26 +1631,35 @@ public partial class ActivityLogAlert // 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.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListBySubscriptionId_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of all Activity Log Alert rules in a subscription. + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// /// + /// Parameters supplied to the 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.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionIdViaIdentity(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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -773,19 +1667,24 @@ public partial class ActivityLogAlert { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.Insights/activityLogAlerts" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -794,101 +1693,145 @@ public partial class ActivityLogAlert // 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.ActivityLogAlert.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ActivityLogAlertsListBySubscriptionId_Call(request,onOk,onDefault,eventListener,sender); + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// - /// 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). + /// + /// Parameters supplied to the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsListBySubscriptionId_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/activityLogAlerts/" + + activityLogAlertName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ActivityLogAlertsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. + /// Json string supplied to the ActivityLogAlertsUpdate 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.ActivityLogAlert.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 ActivityLogAlertsListBySubscriptionId_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string activityLogAlertName, 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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/activityLogAlerts/" + + global::System.Uri.EscapeDataString(activityLogAlertName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ActivityLogAlertsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Activity Log Alert rule. - /// Parameters supplied to the 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). + /// Json string supplied to the ActivityLogAlertsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01"; // Constant Parameters @@ -906,85 +1849,134 @@ public partial class ActivityLogAlert + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ActivityLogAlertsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// - /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Activity Log Alert rule. /// Parameters supplied to the 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.ActivityLogAlert.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ActivityLogAlertsUpdateWithResult(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/activityLogAlerts/(?[^/]+)$", 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.Insights/activityLogAlerts/{activityLogAlertName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var activityLogAlertName = _match.Groups["activityLogAlertName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/activityLogAlerts/" - + activityLogAlertName + + global::System.Uri.EscapeDataString(activityLogAlertName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ActivityLogAlertsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ActivityLogAlertsUpdateWithResult_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.ActivityLogAlert.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 ActivityLogAlertsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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 @@ -994,7 +1986,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_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.ActivityLogAlert.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1005,6 +1997,7 @@ public partial class ActivityLogAlert await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1012,13 +2005,13 @@ public partial class ActivityLogAlert case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1045,7 +2038,7 @@ public partial class ActivityLogAlert /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ActivityLogAlertsUpdate_Validate(string subscriptionId, string resourceGroupName, string activityLogAlertName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.PowerShell.cs similarity index 76% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.PowerShell.cs index 767c038ab912..c56a95b9d87f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActionGroup 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 ActionGroup(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("WebhookProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookPropertiesTypeConverter.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. @@ -103,39 +103,37 @@ internal ActionGroup(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("WebhookProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) content.GetValueForProperty("WebhookProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal)this).WebhookProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookPropertiesTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionGroup(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.ActivityLogAlert.Models.Api20201001.IActionGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionGroup(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.TypeConverter.cs index 5e232f9a73ec..2a8a7318f7f0 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActionGroup ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.cs similarity index 82% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.cs index 386b3671c8fd..5a7c6f5f8b85 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A pointer to an Azure Action Group. public partial class ActionGroup : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class ActionGroup : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties _webhookProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties _webhookProperty; /// /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get => (this._webhookProperty = this._webhookProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties()); set => this._webhookProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get => (this._webhookProperty = this._webhookProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties()); set => this._webhookProperty = value; } /// Creates an new instance. public ActionGroup() @@ -43,6 +43,9 @@ public partial interface IActionGroup : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the Action Group. This cannot be null or empty.", SerializedName = @"actionGroupId", PossibleTypes = new [] { typeof(string) })] @@ -53,10 +56,13 @@ public partial interface IActionGroup : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.", SerializedName = @"webhookProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get; set; } } /// A pointer to an Azure Action Group. @@ -68,7 +74,7 @@ internal partial interface IActionGroupInternal /// /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties WebhookProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties WebhookProperty { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.json.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.json.cs index 362c43786721..8089bd5c9594 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroup.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroup.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ActionGroup(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert { return; } - {_id = If( json?.PropertyT("actionGroupId"), out var __jsonActionGroupId) ? (string)__jsonActionGroupId : (string)Id;} - {_webhookProperty = If( json?.PropertyT("webhookProperties"), out var __jsonWebhookProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties.FromJson(__jsonWebhookProperties) : WebhookProperty;} + {_id = If( json?.PropertyT("actionGroupId"), out var __jsonActionGroupId) ? (string)__jsonActionGroupId : (string)_id;} + {_webhookProperty = If( json?.PropertyT("webhookProperties"), out var __jsonWebhookProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties.FromJson(__jsonWebhookProperties) : _webhookProperty;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionGroup(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.PowerShell.cs index 952a5cf1ef38..8851beb4a2b4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ActionGroupWebhookProperties 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. @@ -84,7 +84,7 @@ internal ActionGroupWebhookProperties(global::System.Collections.IDictionary con } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,29 +103,29 @@ internal ActionGroupWebhookProperties(global::System.Management.Automation.PSObj } /// - /// 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.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionGroupWebhookProperties(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.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionGroupWebhookProperties(content); } @@ -135,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.TypeConverter.cs index 4b26e195a576..41cbd55b9641 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.cs index e44bfb5a142d..658bb5ff64be 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. /// public partial class ActionGroupWebhookProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookPropertiesInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.dictionary.cs index e7af754707c8..6c4cc7e765ac 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.ActionGroupWebhookProperties source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupWebhookProperties source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.json.cs index c201d5999075..41f0798792cd 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionGroupWebhookProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionGroupWebhookProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -73,13 +73,13 @@ internal ActionGroupWebhookProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroupWebhookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroupWebhookProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionGroupWebhookProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.PowerShell.cs similarity index 78% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.PowerShell.cs index 1c8383440160..4f0eb071607c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActionList 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 ActionList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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,33 @@ internal ActionList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionList(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.ActivityLogAlert.Models.Api20201001.IActionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionList(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.TypeConverter.cs index 7e7601c01c1f..2a8c694d8d15 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActionList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs index 650c424c8fe1..7dbde1023cfe 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A list of Activity Log Alert rule actions. public partial class ActionList : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] _actionGroup; + private System.Collections.Generic.List _actionGroup; /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } + public System.Collections.Generic.List ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } /// Creates an new instance. public ActionList() @@ -34,10 +34,13 @@ public partial interface IActionList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } } /// A list of Activity Log Alert rule actions. @@ -45,7 +48,7 @@ internal partial interface IActionListInternal { /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.json.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.json.cs index 9bf62a834695..9d0d5eca7b15 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ActionList(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert. { return; } - {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActionGroup) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroup.FromJson(__u) )) ))() : null : ActionGroup;} + {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActionGroup) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroup.FromJson(__u) )) ))() : null : _actionGroup;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActionList(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs index 56b5c6b07265..6c7772b0da9f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.cs @@ -53,6 +53,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Activity Log Alert rule.", SerializedName = @"activityLogAlertName", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 IActivityLogAlertIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs index 91663a951840..f435c8ec2c1e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertIdentity.json.cs @@ -64,10 +64,10 @@ internal ActivityLogAlertIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { 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;} - {_activityLogAlertName = If( json?.PropertyT("activityLogAlertName"), out var __jsonActivityLogAlertName) ? (string)__jsonActivityLogAlertName : (string)ActivityLogAlertName;} - {_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;} + {_activityLogAlertName = If( json?.PropertyT("activityLogAlertName"), out var __jsonActivityLogAlertName) ? (string)__jsonActivityLogAlertName : (string)_activityLogAlertName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs similarity index 50% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs index 34397279273b..6a37903e6427 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActivityLogAlertResource 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,61 +78,61 @@ internal ActivityLogAlertResource(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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. @@ -147,83 +147,83 @@ internal ActivityLogAlertResource(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActivityLogAlertResource(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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActivityLogAlertResource(content); } @@ -233,7 +233,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.TypeConverter.cs index 7bac2632d0b1..600dc599dbd5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs similarity index 63% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs index 0a605e03d696..c3c6653a4427 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule resource. public partial class ActivityLogAlertResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource(); /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ConditionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).ConditionAllOf = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ConditionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).ConditionAllOf = value ?? null /* arrayOf */; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Description = value ?? null; } /// /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of /// its actions will be activated. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Enabled = value ?? default(bool); } /// The resource Id. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id; } /// /// The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always /// be 'global'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Location = value ?? null; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Action = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Action = value ?? null /* model class */; } /// Internal Acessors for Condition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Condition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Condition = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type = value ?? null; } /// The name of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties _property; /// The Activity Log Alert rule properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] @@ -87,15 +87,15 @@ public partial class ActivityLogAlertResource : /// that fall under one of these prefixes. This list must include at least one item. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public string[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// The tags of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Tag = value ?? null /* model class */; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)__azureResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)__azureResource).Type; } /// Creates an new instance. public ActivityLogAlertResource() @@ -118,28 +118,37 @@ public ActivityLogAlertResource() /// An Activity Log Alert rule resource. public partial interface IActivityLogAlertResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource { /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A description of this Activity Log Alert rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +160,9 @@ public partial interface IActivityLogAlertResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -162,24 +174,27 @@ public partial interface IActivityLogAlertResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// An Activity Log Alert rule resource. internal partial interface IActivityLogAlertResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal { /// The actions that will activate when the condition is met. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get; set; } /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. string Description { get; set; } /// @@ -188,12 +203,12 @@ internal partial interface IActivityLogAlertResourceInternal : /// bool? Enabled { get; set; } /// The Activity Log Alert rule properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties Property { get; set; } /// /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.json.cs similarity index 93% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.json.cs index e9f6b6cdb078..a8bf223e7685 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ActivityLogAlertResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { return; } - __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleProperties.FromJson(__jsonProperties) : Property;} + __azureResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ActivityLogAlertResource(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.PowerShell.cs similarity index 77% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.PowerShell.cs index 5d7eee0a1b55..72ed2dab0201 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AlertRuleAllOfCondition 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. @@ -80,13 +80,13 @@ internal AlertRuleAllOfCondition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.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. @@ -101,35 +101,35 @@ internal AlertRuleAllOfCondition(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.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.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleAllOfCondition(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.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleAllOfCondition(content); } @@ -139,7 +139,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.TypeConverter.cs index 536e9f0e2698..4c0a1c6aea94 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs index cb6cfd165b7e..14016e442798 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// An Activity Log Alert rule condition that is met when all its member conditions are met. /// public partial class AlertRuleAllOfCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] _allOf; + private System.Collections.Generic.List _allOf; /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get => this._allOf; set => this._allOf = value; } + public System.Collections.Generic.List AllOf { get => this._allOf; set => this._allOf = value; } /// Creates an new instance. public AlertRuleAllOfCondition() @@ -36,10 +36,13 @@ public partial interface IAlertRuleAllOfCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List AllOf { get; set; } } /// An Activity Log Alert rule condition that is met when all its member conditions are met. @@ -47,7 +50,7 @@ internal partial interface IAlertRuleAllOfConditionInternal { /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } + System.Collections.Generic.List AllOf { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.json.cs similarity index 89% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.json.cs index fb0f12dc2034..183a27f3d70c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -67,18 +67,18 @@ internal AlertRuleAllOfCondition(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Acti { return; } - {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafCondition.FromJson(__u) )) ))() : null : AllOf;} + {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafCondition.FromJson(__u) )) ))() : null : _allOf;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleAllOfCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs index 3afc7600eea0..50a675617c2b 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -71,7 +71,7 @@ public partial class AlertRuleAnyOfOrLeafCondition 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. @@ -86,25 +86,25 @@ internal AlertRuleAnyOfOrLeafCondition(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("AnyOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (System.Collections.Generic.List) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, 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. @@ -119,47 +119,47 @@ internal AlertRuleAnyOfOrLeafCondition(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("AnyOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[]) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf = (System.Collections.Generic.List) content.GetValueForProperty("AnyOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal)this).AnyOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, 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.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleAnyOfOrLeafCondition(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.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleAnyOfOrLeafCondition(content); } @@ -169,7 +169,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs index f21b8882d2af..2a6e0445d193 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.cs similarity index 76% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.cs index fdb3e34a0b64..38689f9c9844 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -17,37 +17,37 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ /// public partial class AlertRuleAnyOfOrLeafCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafConditionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafConditionInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] _anyOf; + private System.Collections.Generic.List _anyOf; /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get => this._anyOf; set => this._anyOf = value; } + public System.Collections.Generic.List AnyOf { get => this._anyOf; set => this._anyOf = value; } /// /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string[] ContainsAny { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ContainsAny { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).ContainsAny = value ?? null /* arrayOf */; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Equal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal = value ?? null; } + public string Equal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Equal = value ?? null; } /// /// The name of the Activity Log event's field that this condition will examine. @@ -55,7 +55,7 @@ public partial class AlertRuleAnyOfOrLeafCondition : /// 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inherited)] - public string Field { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field = value ?? null; } + public string Field { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)__alertRuleLeafCondition).Field = value ?? null; } /// Creates an new instance. public AlertRuleAnyOfOrLeafCondition() @@ -84,7 +84,7 @@ public AlertRuleAnyOfOrLeafCondition() /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ public partial interface IAlertRuleAnyOfOrLeafCondition : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition { /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. @@ -92,10 +92,13 @@ public partial interface IAlertRuleAnyOfOrLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met.", SerializedName = @"anyOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition) })] + System.Collections.Generic.List AnyOf { get; set; } } /// An Activity Log Alert rule condition that is met when all its member conditions are met. @@ -106,12 +109,12 @@ public partial interface IAlertRuleAnyOfOrLeafCondition : /// * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ internal partial interface IAlertRuleAnyOfOrLeafConditionInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal { /// /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition[] AnyOf { get; set; } + System.Collections.Generic.List AnyOf { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.json.cs similarity index 89% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.json.cs index a98c191200b2..1478127abc20 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -73,19 +73,19 @@ internal AlertRuleAnyOfOrLeafCondition(Microsoft.Azure.PowerShell.Cmdlets.Monito { return; } - __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition(json); - {_anyOf = If( json?.PropertyT("anyOf"), out var __jsonAnyOf) ? If( __jsonAnyOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleLeafCondition.FromJson(__u) )) ))() : null : AnyOf;} + __alertRuleLeafCondition = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition(json); + {_anyOf = If( json?.PropertyT("anyOf"), out var __jsonAnyOf) ? If( __jsonAnyOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IAlertRuleLeafCondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleLeafCondition.FromJson(__u) )) ))() : null : _anyOf;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleAnyOfOrLeafCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.PowerShell.cs similarity index 75% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.PowerShell.cs index 6bcd6c5db88e..9cc252cbd6c4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class AlertRuleLeafCondition 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. @@ -81,21 +81,21 @@ internal AlertRuleLeafCondition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -110,43 +110,43 @@ internal AlertRuleLeafCondition(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Field")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field = (string) content.GetValueForProperty("Field",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Field, global::System.Convert.ToString); } if (content.Contains("Equal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal = (string) content.GetValueForProperty("Equal",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).Equal, global::System.Convert.ToString); } if (content.Contains("ContainsAny")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny = (string[]) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny = (System.Collections.Generic.List) content.GetValueForProperty("ContainsAny",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal)this).ContainsAny, __y => TypeConverterExtensions.SelectToList(__y, 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.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleLeafCondition(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.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleLeafCondition(content); } @@ -156,7 +156,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.TypeConverter.cs index d6938111d784..d5158785d2f7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.cs index 85fbd59ab483..2c80e2e706ea 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -12,19 +12,19 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api /// This condition must contain 'field' and either 'equals' or 'containsAny'. /// public partial class AlertRuleLeafCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafConditionInternal { /// Backing field for property. - private string[] _containsAny; + private System.Collections.Generic.List _containsAny; /// /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string[] ContainsAny { get => this._containsAny; set => this._containsAny = value; } + public System.Collections.Generic.List ContainsAny { get => this._containsAny; set => this._containsAny = value; } /// Backing field for property. private string _equal; @@ -64,16 +64,22 @@ public partial interface IAlertRuleLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met.", SerializedName = @"containsAny", PossibleTypes = new [] { typeof(string) })] - string[] ContainsAny { get; set; } + System.Collections.Generic.List ContainsAny { get; set; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met.", SerializedName = @"equals", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface IAlertRuleLeafCondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'.", SerializedName = @"field", @@ -102,7 +111,7 @@ internal partial interface IAlertRuleLeafConditionInternal /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition /// is met. /// - string[] ContainsAny { get; set; } + System.Collections.Generic.List ContainsAny { get; set; } /// /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. /// diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.json.cs similarity index 92% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.json.cs index ef304cbde819..9a6352de20fc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleLeafCondition.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleLeafCondition.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -68,20 +68,20 @@ internal AlertRuleLeafCondition(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activ { return; } - {_field = If( json?.PropertyT("field"), out var __jsonField) ? (string)__jsonField : (string)Field;} - {_equal = If( json?.PropertyT("equals"), out var __jsonEquals) ? (string)__jsonEquals : (string)Equal;} - {_containsAny = If( json?.PropertyT("containsAny"), out var __jsonContainsAny) ? If( __jsonContainsAny as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ContainsAny;} + {_field = If( json?.PropertyT("field"), out var __jsonField) ? (string)__jsonField : (string)_field;} + {_equal = If( json?.PropertyT("equals"), out var __jsonEquals) ? (string)__jsonEquals : (string)_equal;} + {_containsAny = If( json?.PropertyT("containsAny"), out var __jsonContainsAny) ? If( __jsonContainsAny as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _containsAny;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleLeafCondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleLeafCondition(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs similarity index 74% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs index e5e635fff8d1..409c592b0ee4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRuleList 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 AlertRuleList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal AlertRuleList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleList(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.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleList(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.TypeConverter.cs index 5af2708378b2..a6a184e15928 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.cs similarity index 75% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.cs index 367d591d89ef..5070767099a2 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// A list of Activity Log Alert rules. public partial class AlertRuleList : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleListInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AlertRuleList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] _value; + private System.Collections.Generic.List _value; /// The list of Activity Log Alert rules. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] 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 AlertRuleList() @@ -41,6 +41,9 @@ public partial interface IAlertRuleList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides the link to retrieve the next set of elements.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAlertRuleList : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rules.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource) })] + System.Collections.Generic.List Value { get; set; } } /// A list of Activity Log Alert rules. @@ -62,7 +68,7 @@ internal partial interface IAlertRuleListInternal /// Provides the link to retrieve the next set of elements. string NextLink { get; set; } /// The list of Activity Log Alert rules. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.json.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.json.cs index 7a10c05381ec..e94386ce5698 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlertRuleList(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource.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.ActivityLogAlert.Models.Api20201001.IAlertRuleList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleList(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs similarity index 70% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs index 764b5b67e20d..865a2a67af14 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchObject 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,21 +78,21 @@ internal AlertRulePatchObject(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,43 +107,41 @@ internal AlertRulePatchObject(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTagsTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchObject(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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchObject(content); } @@ -153,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.TypeConverter.cs index 96e71155f592..728f40166f3a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs similarity index 72% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs index 18b4afd8cdac..f4edcdb718ca 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule object for the body of patch operations. public partial class AlertRulePatchObject : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal { /// @@ -18,24 +18,24 @@ public partial class AlertRulePatchObject : /// its actions will be activated. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)Property).Enabled = value ?? default(bool); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties _property; /// The activity log alert settings for an update operation. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags _tag; /// The resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags()); set => this._tag = value; } /// Creates an new instance. public AlertRulePatchObject() @@ -54,6 +54,9 @@ public partial interface IAlertRulePatchObject : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -62,10 +65,13 @@ public partial interface IAlertRulePatchObject : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get; set; } } /// An Activity Log Alert rule object for the body of patch operations. @@ -78,9 +84,9 @@ internal partial interface IAlertRulePatchObjectInternal /// bool? Enabled { get; set; } /// The activity log alert settings for an update operation. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Property { get; set; } /// The resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.json.cs similarity index 93% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.json.cs index 0f4b92e40f64..dba7b6f096d3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AlertRulePatchObject(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activit { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchObject(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.PowerShell.cs index 9775c1dc03d3..c187d70b966c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchObjectTags 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 AlertRulePatchObjectTags(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. @@ -101,29 +101,29 @@ internal AlertRulePatchObjectTags(global::System.Management.Automation.PSObject } /// - /// 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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchObjectTags(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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchObjectTags(content); } @@ -133,7 +133,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.TypeConverter.cs index 76454ae17fcf..7e5a02bc09cb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.cs index b38ce8711f04..565dbd9390eb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The resource tags public partial class AlertRulePatchObjectTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.dictionary.cs index eda27721dcbf..bbba93208de3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.AlertRulePatchObjectTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObjectTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.json.cs index 8246e249bd68..cd5ed8318059 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObjectTags.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObjectTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AlertRulePatchObjectTags(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchObjectTags(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.PowerShell.cs similarity index 82% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.PowerShell.cs index a1bbae4152dc..82756482f129 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRulePatchProperties 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 AlertRulePatchProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,35 @@ internal AlertRulePatchProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRulePatchProperties(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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRulePatchProperties(content); } @@ -137,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.TypeConverter.cs index 2ee2560a3b9b..72a8633911d1 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.cs index 12d630f8f515..e40964f818ae 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Activity Log Alert rule properties for patch operations. public partial class AlertRulePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchPropertiesInternal { /// Backing field for property. @@ -40,6 +40,9 @@ public partial interface IAlertRulePatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.json.cs similarity index 94% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.json.cs index 3b44c9aed7b2..f428b86e1059 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AlertRulePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Act { return; } - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRulePatchProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs similarity index 57% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs index b873f77ac568..0dc25a194f0a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AlertRuleProperties 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,37 +78,37 @@ internal AlertRuleProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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. @@ -123,59 +123,57 @@ internal AlertRuleProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Condition")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfConditionTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Condition, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfConditionTypeConverter.ConvertFrom); } if (content.Contains("Action")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionListTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ConditionAllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("ConditionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ConditionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAnyOfOrLeafConditionTypeConverter.ConvertFrom)); } if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionGroupTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AlertRuleProperties(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.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AlertRuleProperties(content); } @@ -185,7 +183,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.TypeConverter.cs index 9dc1c9a5d180..93dd5d623caa 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs index f2eb91582334..91baab8296fc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Azure Activity Log Alert rule. public partial class AlertRuleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList _action; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList _action; /// The actions that will activate when the condition is met. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList()); set => this._action = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList()); set => this._action = value; } /// The list of the Action Groups. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionListInternal)Action).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal)Action).ActionGroup = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition _condition; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition _condition; /// The condition that will cause this alert to activate. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition()); set => this._condition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition()); set => this._condition = value; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)Condition).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfConditionInternal)Condition).AllOf = value ; } + public System.Collections.Generic.List ConditionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)Condition).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal)Condition).AllOf = value ; } /// Backing field for property. private string _description; @@ -53,20 +53,20 @@ public partial class AlertRuleProperties : public bool? Enabled { get => this._enabled; set => this._enabled = value; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList()); set { {_action = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList()); set { {_action = value;} } } /// Internal Acessors for Condition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePropertiesInternal.Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition()); set { {_condition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal.Condition { get => (this._condition = this._condition ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition()); set { {_condition = value;} } } /// Backing field for property. - private string[] _scope; + private System.Collections.Generic.List _scope; /// /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string[] Scope { get => this._scope; set => this._scope = value; } + public System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } /// Creates an new instance. public AlertRuleProperties() @@ -82,22 +82,31 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } /// The list of Activity Log Alert rule conditions. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A description of this Activity Log Alert rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -120,10 +132,13 @@ public partial interface IAlertRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// An Azure Activity Log Alert rule. @@ -131,13 +146,13 @@ internal partial interface IAlertRulePropertiesInternal { /// The actions that will activate when the condition is met. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get; set; } /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } + System.Collections.Generic.List ConditionAllOf { get; set; } /// A description of this Activity Log Alert rule. string Description { get; set; } /// @@ -149,7 +164,7 @@ internal partial interface IAlertRulePropertiesInternal /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs /// that fall under one of these prefixes. This list must include at least one item. /// - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.json.cs similarity index 90% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.json.cs index 25428d1224c7..fa458d8f287e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,22 +65,22 @@ internal AlertRuleProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Activity { return; } - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRuleAllOfCondition.FromJson(__jsonCondition) : Condition;} - {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActionList.FromJson(__jsonActions) : Action;} - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Scope;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRuleAllOfCondition.FromJson(__jsonCondition) : _condition;} + {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActionList.FromJson(__jsonActions) : _action;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _scope;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AlertRuleProperties(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs similarity index 69% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs index 89d9946ddcfa..2ce95afb60fb 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,29 +78,29 @@ internal AzureResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.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. @@ -115,51 +115,49 @@ internal AzureResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTagsTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResource(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.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResource(content); } @@ -169,7 +167,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.TypeConverter.cs index ce9754e30c38..3e5c96f0e1b4 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAzureResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.cs similarity index 85% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.cs index 1e7e322f4f3c..94aca1123004 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// An Azure resource object. public partial class AzureResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal { /// Backing field for property. @@ -31,13 +31,13 @@ public partial class AzureResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -47,11 +47,11 @@ public partial class AzureResource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags _tag; /// The tags of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -74,6 +74,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +88,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +99,9 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -101,14 +110,20 @@ public partial interface IAzureResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tags of the resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get; set; } /// The type of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -129,7 +144,7 @@ internal partial interface IAzureResourceInternal /// The name of the resource. string Name { get; set; } /// The tags of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get; set; } /// The type of the resource. string Type { get; set; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.json.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.json.cs index 9eb7f6418719..13c86fe0afbe 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,22 +65,22 @@ internal AzureResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { return; } - {_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;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AzureResourceTags.FromJson(__jsonTags) : Tag;} + {_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;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AzureResource(json) : null; } @@ -104,19 +104,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.PowerShell.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.PowerShell.cs index af387ea36bfa..d0a70ef9f19b 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureResourceTags 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 AzureResourceTags(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. @@ -101,29 +101,27 @@ internal AzureResourceTags(global::System.Management.Automation.PSObject 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.ActivityLogAlert.Models.Api20201001.IAzureResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureResourceTags(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.ActivityLogAlert.Models.Api20201001.IAzureResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureResourceTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.TypeConverter.cs index b34757a77e0e..7aa605cf31f6 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAzureResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.cs similarity index 91% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.cs index a71c7826eb33..74351f0d3619 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The tags of the resource. public partial class AzureResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.dictionary.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.dictionary.cs index 2c2deabe1ecc..f7fcb953c50d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.dictionary.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.AzureResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AzureResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.json.cs similarity index 96% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.json.cs index 913d7477e25f..eace8e19ef49 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResourceTags.json.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResourceTags.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AzureResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLo } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new AzureResourceTags(json) : null; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 79% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 856a168cbf56..0f6c36d9daf2 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; @@ -63,35 +63,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.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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. @@ -106,17 +104,17 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,11 +129,11 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +143,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.ActivityLogAlert.Models.Api20201001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 3a6bbc66006a..57ecfa245484 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs similarity index 88% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs index 5230946a87b0..1e6effd0dabc 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; /// The error response. public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class ErrorResponse : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorResponse() @@ -47,6 +47,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs rename to generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs index 305deb8c1476..43f49f3d4637 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAle { 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;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs index 858f19f10363..eb99410b8c79 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get an Activity Log Alert rule. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get an Activity Log Alert rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +114,7 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +160,8 @@ public partial class GetAzActivityLogAlert_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_Get() { @@ -261,8 +287,33 @@ public GetAzActivityLogAlert_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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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 +465,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs index 6d26f382301c..d12fa7500182 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get an Activity Log Alert rule. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get an Activity Log Alert rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +107,7 @@ public partial class GetAzActivityLogAlert_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +130,24 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzActivityLogAlert_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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs index 16e1ce0e9894..1b3ad6d74b21 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get a list of all Activity Log Alert rules in a subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] ListBySubscriptionId=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get a list of all Activity Log Alert rules in a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +105,7 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +137,8 @@ public partial class GetAzActivityLogAlert_List : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_List() { @@ -238,8 +264,33 @@ public GetAzActivityLogAlert_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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList + 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/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs index de8d0aa7f3c2..fed0ed7f6e57 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/GetAzActivityLogAlert_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Get a list of all Activity Log Alert rules in a resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzActivityLogAlert_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf and Scope will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Get a list of all Activity Log Alert rules in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts", ApiVersion = "2020-10-01")] public partial class GetAzActivityLogAlert_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +105,7 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +151,8 @@ public partial class GetAzActivityLogAlert_List1 : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzActivityLogAlert_List1() { @@ -252,8 +278,33 @@ public GetAzActivityLogAlert_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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList /// 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 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList + 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/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs index ab3e5e54cefb..ae4b426830d3 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateExpanded.cs @@ -6,21 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; - /// Create a new Activity Log Alert rule or update an existing one. + /// create a new Activity Log Alert rule or create an existing one. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Create a new Activity Log Alert rule or update an existing one.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +34,25 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag private string __processRecordId; /// An Activity Log Alert rule resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.ActivityLogAlertResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource(); /// /// 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; + /// The list of the Action Groups. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Action Groups.")] @@ -48,15 +62,17 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The list of the Action Groups.", SerializedName = @"actionGroups", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("ActionGroup", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup ?? null /* arrayOf */; set => _activityLogAlertRuleBody.ActionGroup = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -69,9 +85,8 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The list of Activity Log Alert rule conditions.", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("ConditionAllOf", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf ?? null /* arrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -108,6 +123,9 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRuleBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRuleBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -163,7 +181,7 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -208,8 +226,7 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.ParameterBreakingChange("Scope", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public string[] Scope { get => _activityLogAlertRuleBody.Scope ?? null /* arrayOf */; set => _activityLogAlertRuleBody.Scope = value; } + public string[] Scope { get => _activityLogAlertRuleBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -225,7 +242,8 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -238,44 +256,44 @@ public partial class NewAzActivityLogAlert_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"The tags of the resource.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) @@ -298,6 +316,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.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -362,8 +385,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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -373,7 +421,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzActivityLogAlert_CreateExpanded() { @@ -427,7 +475,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -440,12 +488,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ActivityLogAlertsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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=_activityLogAlertRuleBody}) + 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 } }); @@ -481,12 +529,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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 ) { @@ -498,8 +546,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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; + } + } } } @@ -507,12 +573,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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ) { @@ -529,15 +595,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.ActivityLogAlert.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=_activityLogAlertRuleBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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=_activityLogAlertRuleBody }) + 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 } }); @@ -547,12 +613,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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 ) { @@ -564,8 +630,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..e1845b2c106b --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaIdentityExpanded.cs @@ -0,0 +1,636 @@ +// 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.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + public partial class NewAzActivityLogAlert_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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; + + /// An Activity Log Alert rule resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource _activityLogAlertRuleBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.ActivityLogAlertResource(); + + /// + /// 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; + + /// The list of the Action Groups. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of the Action Groups.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of the Action Groups.", + SerializedName = @"actionGroups", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[] Action { get => _activityLogAlertRuleBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; + + /// The list of Activity Log Alert rule conditions. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Activity Log Alert rule conditions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Activity Log Alert rule conditions.", + SerializedName = @"allOf", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[] Condition { get => _activityLogAlertRuleBody.ConditionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.ConditionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// A description of this Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A description of this Activity Log Alert rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A description of this Activity Log Alert rule.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + public string Description { get => _activityLogAlertRuleBody.Description ?? null; set => _activityLogAlertRuleBody.Description = value; } + + /// + /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of + /// its actions will be activated. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRuleBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRuleBody.Enabled = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always + /// be 'global'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _activityLogAlertRuleBody.Location ?? null; set => _activityLogAlertRuleBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs + /// that fall under one of these prefixes. This list must include at least one item. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item.", + SerializedName = @"scopes", + PossibleTypes = new [] { typeof(string) })] + public string[] Scope { get => _activityLogAlertRuleBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _activityLogAlertRuleBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The tags of the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tags of the resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tags of the resource.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags Tag { get => _activityLogAlertRuleBody.Tag ?? null /* object */; set => _activityLogAlertRuleBody.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 NewAzActivityLogAlert_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ActivityLogAlertsCreateOrUpdateViaIdentity(InputObject.Id, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ActivityLogAlertName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ActivityLogAlertName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ActivityLogAlertsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRuleBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonFilePath.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..af9747ac0d82 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_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.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class NewAzActivityLogAlert_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 NewAzActivityLogAlert_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonString.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_CreateViaJsonString.cs new file mode 100644 index 000000000000..a131509f067a --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/NewAzActivityLogAlert_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.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// create a new Activity Log Alert rule or create an existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzActivityLogAlert_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"create a new Activity Log Alert rule or create an existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class NewAzActivityLogAlert_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 NewAzActivityLogAlert_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs index f23811541c58..bffb7c400ca0 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Delete an Activity Log Alert rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class RemoveAzActivityLogAlert_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzActivityLogAlert_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(); + + /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -146,7 +167,8 @@ public partial class RemoveAzActivityLogAlert_Delete : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,12 +177,12 @@ public partial class RemoveAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 @@ -203,6 +225,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.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -342,7 +394,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 } }); @@ -355,7 +407,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzActivityLogAlert_Delete() { @@ -388,12 +440,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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ) { @@ -410,15 +462,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.ActivityLogAlert.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.ActivityLogAlert.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 } }); @@ -443,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); } @@ -467,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/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs index 5935a4385c2c..3ee9bd801265 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/RemoveAzActivityLogAlert_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// Delete an Activity Log Alert rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzActivityLogAlert_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(); + + /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzActivityLogAlert_DeleteViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 @@ -164,6 +185,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.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzActivityLogAlert_DeleteViaIdentity() { @@ -369,12 +420,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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ) { @@ -391,7 +442,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.ActivityLogAlert.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 } @@ -424,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); } @@ -448,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/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs index b7392cc3e1da..a5705827cdbf 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateExpanded.cs @@ -6,24 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,18 +37,33 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma private string __processRecordId; /// An Activity Log Alert rule object for the body of patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObject(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObject(); /// /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -74,6 +91,9 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRulePatchBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRulePatchBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -115,7 +135,7 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -161,7 +181,8 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -174,32 +195,32 @@ public partial class UpdateAzActivityLogAlert_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) @@ -222,6 +243,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.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -286,8 +312,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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -343,7 +394,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -356,12 +407,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ActivityLogAlertsUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdate(SubscriptionId, ResourceGroupName, Name, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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=_activityLogAlertRulePatchBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,7 +432,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzActivityLogAlert_UpdateExpanded() { @@ -407,12 +458,12 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ) { @@ -429,15 +480,15 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.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=_activityLogAlertRulePatchBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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=_activityLogAlertRulePatchBody }) + 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 } }); @@ -447,12 +498,12 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 ) { @@ -464,8 +515,26 @@ public UpdateAzActivityLogAlert_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs index d12a72ff5748..f020e7640535 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaIdentityExpanded.cs @@ -6,24 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; using System; /// - /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and - /// to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, NewOutputProperties=new string[] {"ActionGroup","ConditionAllOf","Scope","AnyOf"}, ChangeDescription="The types of the properties ActionGroup, ConditionAllOf, Scope and AnyOf will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,18 +37,33 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global private string __processRecordId; /// An Activity Log Alert rule object for the body of patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.AlertRulePatchObject(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject _activityLogAlertRulePatchBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.AlertRulePatchObject(); /// /// 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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.ClientAPI; @@ -74,6 +91,9 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _activityLogAlertRulePatchBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _activityLogAlertRulePatchBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -108,7 +128,7 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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")] @@ -135,32 +155,32 @@ public partial class UpdateAzActivityLogAlert_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"The resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get => _activityLogAlertRulePatchBody.Tag ?? null /* object */; set => _activityLogAlertRulePatchBody.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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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) @@ -183,6 +203,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.ActivityLogAlert.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -247,8 +272,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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -304,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +369,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ActivityLogAlertsUpdateViaIdentity(InputObject.Id, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdateViaIdentity(InputObject.Id, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); } else { @@ -336,13 +386,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ActivityLogAlertName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ActivityLogAlertsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline); + await this.Client.ActivityLogAlertsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ActivityLogAlertName ?? null, _activityLogAlertRulePatchBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_activityLogAlertRulePatchBody}) + 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 } }); @@ -362,7 +412,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() { @@ -388,12 +438,12 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 ) { @@ -410,15 +460,15 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_activityLogAlertRulePatchBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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=_activityLogAlertRulePatchBody }) + 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 } }); @@ -428,12 +478,12 @@ public UpdateAzActivityLogAlert_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.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource /// 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 ) { @@ -445,8 +495,26 @@ public UpdateAzActivityLogAlert_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..80995f6ae6cd --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonFilePath.cs @@ -0,0 +1,528 @@ +// 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.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class UpdateAzActivityLogAlert_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzActivityLogAlert_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs new file mode 100644 index 000000000000..db96eaaf8cb2 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/cmdlets/UpdateAzActivityLogAlert_UpdateViaJsonString.cs @@ -0,0 +1,526 @@ +// 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.ActivityLogAlert.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Cmdlets; + using System; + + /// + /// update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to + /// enable or disable the Alert rule. To update other fields use CreateOrupdate operation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzActivityLogAlert_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Description(@"update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrupdate operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}", ApiVersion = "2020-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.NotSuggestDefaultParameterSet] + public partial class UpdateAzActivityLogAlert_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Activity Log Alert rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Activity Log Alert rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Activity Log Alert rule.", + SerializedName = @"activityLogAlertName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ActivityLogAlertName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ActivityLogAlertsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ActivityLogAlertsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzActivityLogAlert_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Models.IActivityLogAlertResource + /// 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.ActivityLogAlert.Models.IActivityLogAlertResource + 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/ActivityLogAlert.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..6633d4b8a3cf --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert +{ + 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/ActivityLogAlert.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..f2b6e798cd83 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert +{ + 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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 9a7e957256c8..26b0a5cfde75 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 7458967688e3..d104e6d82482 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index b731d088a708..537531e3b3b9 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 8dd9989f3d27..d0b8f97a512a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 56f360de179f..0c5911560b0e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 78da6d6005c8..8b83d669d79f 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index e66ca7dd5d77..2a19ee8ae3d6 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index ace2839af38e..c3886761afad 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index b05c10ab6a2f..2ecc57b4d607 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 82a9da9111a9..c494dbdf37c5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 15963896560b..f5e68930111a 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 83627d4e4587..f039e31e002c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs index cc0c40124316..01b1c59accd7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/Context.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..18afb39f0c9e --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.ActivityLogAlert Client { get; } + } +} diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs index f7845c06b74e..dd776f1b4a59 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs index d8c739d6560a..476893fb8d28 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs index 6a777af1b473..509368017d36 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..a012e7be44de --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.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.ActivityLogAlert.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.ActivityLogAlert.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs index 1ed0d5918f95..3c770058825d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.ActivityLogAlert" : @"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/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 749022e25164..57fbf0dc6ed5 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs index 683a21976a53..22eab11ce810 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs index 37cca7f0e136..d321674f08b7 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/ActivityLogAlert.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/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 index 8316664a0ce5..f56145932551 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/New-AzActivityLogAlert.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Description -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Example $scope = "/subscriptions/"+(Get-AzContext).Subscription.ID $actiongroup=New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} @@ -29,8 +29,10 @@ $any2=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incid $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any1,$any2 New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,78 +44,100 @@ ACTION : The list of the Action Groups. [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + +INPUTOBJECT : Identity Parameter + [ActivityLogAlertName ]: The name of the Activity Log Alert rule. + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the Activity Log Alert rule. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -122,13 +146,26 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -185,13 +222,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -200,6 +241,9 @@ begin { } $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/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 index c1f0dd5cfe3b..29a48bd594c9 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Description -Create a new Activity Log Alert rule or update an existing one. +Create a new Activity Log Alert rule or create an existing one. .Example $scope = "/subscriptions/"+(Get-AzContext).Subscription.ID $actiongroup=New-AzActivityLogAlertActionGroupObject -Id $ActionGroupResourceId -WebhookProperty @{"sampleWebhookProperty"="SamplePropertyValue"} @@ -29,8 +29,10 @@ $any2=New-AzActivityLogAlertAlertRuleLeafConditionObject -Field properties.incid $condition3=New-AzActivityLogAlertAlertRuleAnyOfOrLeafConditionObject -AnyOf $any1,$any2 New-AzActivityLogAlert -Name $AlertName -ResourceGroupName $ResourceGroupName -Action $actiongroup -Condition @($condition1,$condition2,$condition3) -Location global -Scope $scope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,78 +44,100 @@ ACTION : The list of the Action Groups. [(Any) ]: This indicates any property can be added to this object. CONDITION : The list of Activity Log Alert rule conditions. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. - [AnyOf ]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. - [ContainsAny ]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + [AnyOf >]: An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + [ContainsAny >]: The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. [Equal ]: The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. [Field ]: The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + +INPUTOBJECT : Identity Parameter + [ActivityLogAlertName ]: The name of the Activity Log Alert rule. + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [SubscriptionId ]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azactivitylogalert #> function New-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the Activity Log Alert rule. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionGroup[]] # The list of the Action Groups. - # To construct, see NOTES section for ACTION properties and create a hash table. ${Action}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition[]] # The list of Activity Log Alert rule conditions. - # To construct, see NOTES section for CONDITION properties and create a hash table. ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # A description of this Activity Log Alert rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String] # The location of the resource. # Since Azure Activity Log Alerts is a global service, the location of the rules should always be 'global'. ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] [System.String[]] @@ -122,13 +146,26 @@ param( # This list must include at least one item. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResourceTags]))] [System.Collections.Hashtable] # The tags of the resource. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -185,13 +222,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ CreateExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ActivityLogAlert.private\New-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -200,6 +241,9 @@ begin { } $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) @@ -231,20 +275,20 @@ end { <# .Synopsis -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Description -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Example Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName -Tag @{"key"="val"} -Enabled $false .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -259,10 +303,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -270,6 +316,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -277,6 +325,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -287,23 +337,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # 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.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -360,14 +423,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -376,6 +442,9 @@ begin { } $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/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 index f8e6b5430e57..840742c31928 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/internal/Update-AzActivityLogAlert.ps1 @@ -16,20 +16,20 @@ <# .Synopsis -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Description -Updates 'tags' and 'enabled' fields in an existing Alert rule. +Update 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. -To update other fields use CreateOrUpdate operation. +To update other fields use CreateOrupdate operation. .Example Update-AzActivityLogAlert -ResourceGroupName $ResourceGroupName -Name $AlertName -Tag @{"key"="val"} -Enabled $false .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,10 +44,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azactivitylogalert #> function Update-AzActivityLogAlert { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ActivityLogAlertName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] @@ -55,6 +57,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [System.String] # The name of the resource group. @@ -62,6 +66,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -72,23 +78,36 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertIdentity] # 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.ActivityLogAlert.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this Activity Log Alert rule is enabled. # If an Activity Log Alert rule is not enabled, then none of its actions will be activated. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags]))] [System.Collections.Hashtable] # The resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -145,14 +164,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ActivityLogAlert.private\Update-AzActivityLogAlert_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.ActivityLogAlert.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 { @@ -161,6 +183,9 @@ begin { } $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/ActivityLogAlert.Autorest/test-module.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 index 5977523d625a..745b4fb17007 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/test-module.ps1 +++ b/generated/Monitor/ActivityLogAlert.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/Autoscale.Autorest/Az.Autoscale.format.ps1xml b/generated/Monitor/Autoscale.Autorest/Az.Autoscale.format.ps1xml index 506d8ef0695c..36e8f0ca5a3d 100644 --- a/generated/Monitor/Autoscale.Autorest/Az.Autoscale.format.ps1xml +++ b/generated/Monitor/Autoscale.Autorest/Az.Autoscale.format.ps1xml @@ -2,85 +2,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseError - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseError#Multiple - - - - - - - - - - - - - - AutoscaleSettingName - - - ResourceGroupName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData - - - - - - - - - - - + - + - + - + - CreatedAt - - - CreatedBy - - - CreatedByType + Code - LastModifiedAt + Detail - LastModifiedBy + Message - LastModifiedByType + Target @@ -88,39 +42,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleIdentity#Multiple - - - - + - + - + - Code - - - Detail + AutoscaleSettingName - Message + ResourceGroupName - Target + SubscriptionId @@ -128,9 +76,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification#Multiple @@ -150,9 +98,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile#Multiple @@ -172,9 +120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting#Multiple @@ -212,9 +160,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource#Multiple @@ -242,6 +190,9 @@ + + + @@ -270,15 +221,18 @@ SystemDataLastModifiedByType + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceCollection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceCollection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection#Multiple @@ -298,9 +252,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTags#Multiple @@ -320,15 +274,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotification - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotification#Multiple - - - @@ -339,9 +290,6 @@ - - CustomEmail - SendToSubscriptionAdministrator @@ -354,9 +302,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTrigger + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTrigger - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTrigger + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTrigger#Multiple @@ -424,9 +372,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicy + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicy + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicy#Multiple @@ -446,9 +394,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveResponse - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveResponse#Multiple @@ -480,9 +428,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveValue + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveValue - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveValue + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveValue#Multiple @@ -508,9 +456,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Recurrence + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Recurrence - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Recurrence + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Recurrence#Multiple @@ -530,21 +478,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentSchedule - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentSchedule#Multiple - - - - - - - - - @@ -552,15 +491,6 @@ - - Day - - - Hour - - - Minute - TimeZone @@ -570,9 +500,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Resource#Multiple @@ -598,9 +528,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTags#Multiple @@ -620,9 +550,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleAction + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleAction - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleAction + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleAction#Multiple @@ -648,9 +578,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacity#Multiple @@ -682,9 +612,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension#Multiple @@ -694,9 +624,6 @@ - - - @@ -707,8 +634,57 @@ Operator + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + - Value + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType @@ -716,9 +692,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindow + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindow - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindow + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindow#Multiple @@ -750,9 +726,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification#Multiple @@ -772,9 +748,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationProperties#Multiple diff --git a/generated/Monitor/Autoscale.Autorest/Az.Autoscale.psd1 b/generated/Monitor/Autoscale.Autorest/Az.Autoscale.psd1 index 2d65a82092e0..5d35f3cd2ad8 100644 --- a/generated/Monitor/Autoscale.Autorest/Az.Autoscale.psd1 +++ b/generated/Monitor/Autoscale.Autorest/Az.Autoscale.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Autoscale.private.dll' FormatsToProcess = './Az.Autoscale.format.ps1xml' - FunctionsToExport = 'Get-AzAutoscalePredictiveMetric', 'Get-AzAutoscaleSetting', 'New-AzAutoscaleNotificationObject', 'New-AzAutoscaleProfileObject', 'New-AzAutoscaleScaleRuleMetricDimensionObject', 'New-AzAutoscaleScaleRuleObject', 'New-AzAutoscaleSetting', 'New-AzAutoscaleWebhookNotificationObject', 'Remove-AzAutoscaleSetting', 'Update-AzAutoscaleSetting', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzAutoscalePredictiveMetric', 'Get-AzAutoscaleSetting', 'New-AzAutoscaleNotificationObject', 'New-AzAutoscaleProfileObject', 'New-AzAutoscaleScaleRuleMetricDimensionObject', 'New-AzAutoscaleScaleRuleObject', 'New-AzAutoscaleSetting', 'New-AzAutoscaleWebhookNotificationObject', 'Remove-AzAutoscaleSetting', 'Update-AzAutoscaleSetting' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Autoscale' diff --git a/generated/Monitor/Autoscale.Autorest/check-dependencies.ps1 b/generated/Monitor/Autoscale.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/Autoscale.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 index e55e2eaab1af..d1651977b103 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 @@ -16,16 +16,16 @@ <# .Synopsis -get predictive autoscale metric future data +Get predictive autoscale metric future data .Description -get predictive autoscale metric future data +Get predictive autoscale metric future data .Example Get-AzAutoscalePredictiveMetric -AutoscaleSettingName test-autoscalesetting -ResourceGroupName test-group -Timespan "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z" -Aggregation "Total" -Interval ([System.TimeSpan]::New(0,60,0)) -MetricName "PercentageCPU" -MetricNamespace "Microsoft.Compute/virtualMachineScaleSets" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -40,7 +40,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azautoscalepredictivemetric #> function Get-AzAutoscalePredictiveMetric { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse])] [CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(Mandatory)] @@ -160,6 +159,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,9 +190,7 @@ begin { Get = 'Az.Autoscale.private\Get-AzAutoscalePredictiveMetric_Get'; GetViaIdentity = 'Az.Autoscale.private\Get-AzAutoscalePredictiveMetric_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -198,6 +204,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/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 index 1f76e0f7e3e0..984d33f5063a 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 @@ -29,7 +29,7 @@ Get-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesetting .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azautoscalesetting #> function Get-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -75,7 +75,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,6 +133,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,9 +166,7 @@ begin { List = 'Az.Autoscale.private\Get-AzAutoscaleSetting_List'; List1 = 'Az.Autoscale.private\Get-AzAutoscaleSetting_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.Autoscale.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 { @@ -174,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/Autoscale.Autorest/exports/New-AzAutoscaleNotificationObject.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleNotificationObject.ps1 index 1b941a004bba..caecfbbb4826 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleNotificationObject.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleNotificationObject.ps1 @@ -24,7 +24,7 @@ $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "ht New-AzAutoscaleNotificationObject -EmailCustomEmail "gu@ms.com" -EmailSendToSubscriptionAdministrator $true -EmailSendToSubscriptionCoAdministrator $true -Webhook $webhook1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification .Notes COMPLEX PARAMETER PROPERTIES @@ -35,10 +35,10 @@ WEBHOOK : the collection of webhook notifications. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleNotificationObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalenotificationobject #> function New-AzAutoscaleNotificationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -62,9 +62,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification[]] # the collection of webhook notifications. - # To construct, see NOTES section for WEBHOOK properties and create a hash table. ${Webhook} ) @@ -75,6 +74,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -103,6 +105,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/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 index 473d7578c414..905e4ba6f2fa 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleProfileObject.ps1 @@ -25,7 +25,7 @@ $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile .Notes COMPLEX PARAMETER PROPERTIES @@ -34,28 +34,28 @@ To create the parameters described below, construct a hash table containing the RULE : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. [ScaleActionValue ]: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleProfileObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscaleprofileobject #> function New-AzAutoscaleProfileObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -86,10 +86,9 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule[]] # the collection of rules that provide the triggers and parameters for the scaling action. # A maximum of 10 rules can be specified. - # To construct, see NOTES section for RULE properties and create a hash table. ${Rule}, [Parameter()] @@ -121,9 +120,9 @@ param( ${FixedDateTimeZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency] + [System.String] # 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. @@ -175,6 +174,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -203,6 +205,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/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 index e38b280ee521..ced995433387 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for ScaleRuleMetricDimension. New-AzAutoscaleScaleRuleMetricDimensionObject -DimensionName VMName -Operator 'Equals' -Value test-vm .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleMetricDimensionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescalerulemetricdimensionobject #> function New-AzAutoscaleScaleRuleMetricDimensionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -38,9 +38,9 @@ param( ${DimensionName}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType] + [System.String] # the dimension operator. # Only 'Equals' and 'NotEquals' are supported. # 'Equals' being equal to any of the values. @@ -62,6 +62,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -90,6 +93,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/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 index 4ba803001e1e..cacf6abbd8b4 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleScaleRuleObject.ps1 @@ -24,7 +24,7 @@ $subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule .Notes COMPLEX PARAMETER PROPERTIES @@ -32,13 +32,13 @@ To create the parameters described below, construct a hash table containing the METRICTRIGGERDIMENSION : List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescaleruleobject #> function New-AzAutoscaleScaleRuleObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -54,16 +54,16 @@ param( ${MetricTriggerMetricResourceUri}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType] + [System.String] # the operator that is used to compare the metric data and the threshold. ${MetricTriggerOperator}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType] + [System.String] # the metric statistic type. # How the metrics from multiple instances are combined. ${MetricTriggerStatistic}, @@ -75,9 +75,9 @@ param( ${MetricTriggerThreshold}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType] + [System.String] # time aggregation type. # How the data that is collected should be combined over time. # The default value is Average. @@ -107,26 +107,25 @@ param( ${ScaleActionCooldown}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection] + [System.String] # the scale direction. # Whether the scaling action increases or decreases the number of instances. ${ScaleActionDirection}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType] + [System.String] # the type of action that should occur when the scale rule fires. ${ScaleActionType}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension[]] # List of dimension conditions. # For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - # To construct, see NOTES section for METRICTRIGGERDIMENSION properties and create a hash table. ${MetricTriggerDimension}, [Parameter()] @@ -163,6 +162,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -191,6 +193,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 index 18ba53498e06..bcd67535f487 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates or updates an autoscale setting. +Create an autoscale setting. .Description -Creates or updates an autoscale setting. +Create an autoscale setting. .Example $subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) @@ -27,111 +27,43 @@ $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "ht $notification1=New-AzAutoscaleNotificationObject -EmailCustomEmail "gu@ms.com" -EmailSendToSubscriptionAdministrator $true -EmailSendToSubscriptionCoAdministrator $true -Webhook $webhook1 New-AzAutoscaleSetting -Name test-autoscalesetting -ResourceGroupName test-group -Location westeurope -Profile $profile1 -Enabled -Notification $notification1 -PredictiveAutoscalePolicyScaleLookAheadTime ([System.TimeSpan]::New(0,5,0)) -PredictiveAutoscalePolicyScaleMode 'Enabled' -PropertiesName "test-autoscalesetting" -TargetResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter - [AutoscaleSettingName ]: The autoscale setting name. - [Id ]: Resource identity path - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SubscriptionId ]: The ID of the target subscription. - NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. -PARAMETER : The autoscale setting resource. - Location : Resource location - Profile : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. - CapacityDefault : 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. - CapacityMaximum : 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. - CapacityMinimum : the minimum number of instances for the resource. - Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. - MetricTriggerMetricName : the name of the metric that defines what the rule monitors. - MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. - MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. - MetricTriggerTimeGrain : 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. - MetricTriggerTimeWindow : 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. - ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. - [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. - [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. - [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. - [ScaleActionValue ]: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. - [FixedDateEnd ]: the end time for the profile in ISO 8601 format. - [FixedDateStart ]: the start time for the profile in ISO 8601 format. - [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. - [ScheduleTimeZone ]: 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 - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. - [Tag ]: Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. - [(Any) ]: This indicates any property can be added to this object. - [Enabled ]: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. - [Notification ]: the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. - [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. - [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. - [Property ]: a property bag of settings. This value can be empty. - [(Any) ]: This indicates any property can be added to this object. - [ServiceUri ]: the service address to receive the notification. - [PredictiveAutoscalePolicyScaleLookAheadTime ]: the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format. - [PredictiveAutoscalePolicyScaleMode ]: the predictive autoscale mode - [PropertiesName ]: the name of the autoscale setting. - [TargetResourceLocation ]: the location of the resource that the autoscale setting should be added to. - [TargetResourceUri ]: the resource identifier of the resource that the autoscale setting should be added to. - PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. CapacityDefault : 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. CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -139,46 +71,39 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azautoscalesetting #> function New-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] -[CmdletBinding(DefaultParameterSetName='CreateViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(Mandatory)] [Alias('AutoscaleSettingName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The autoscale setting name. ${Name}, - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] @@ -188,10 +113,9 @@ param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. - # To construct, see NOTES section for PROFILE properties and create a hash table. ${Profile}, [Parameter(ParameterSetName='CreateExpanded')] @@ -205,9 +129,8 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. - # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, [Parameter(ParameterSetName='CreateExpanded')] @@ -218,9 +141,9 @@ param( ${PredictiveAutoscalePolicyScaleLookAheadTime}, [Parameter(ParameterSetName='CreateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, @@ -232,7 +155,7 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags]))] [System.Collections.Hashtable] # Gets or sets a list of key value pairs that describe the resource. # These tags can be used in viewing and grouping this resource (across resource groups). @@ -252,12 +175,17 @@ param( # the resource identifier of the resource that the autoscale setting should be added to. ${TargetResourceUri}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource] - # The autoscale setting resource. - # To construct, see NOTES section for PARAMETER properties and create a hash table. - ${Parameter}, + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -315,6 +243,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -335,11 +272,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateExpanded'; - CreateViaIdentity = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateViaIdentity'; + CreateViaJsonFilePath = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Autoscale.private\New-AzAutoscaleSetting_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.Autoscale.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 { @@ -353,6 +289,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/Autoscale.Autorest/exports/New-AzAutoscaleWebhookNotificationObject.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleWebhookNotificationObject.ps1 index b6234f8f5a66..cf7dc5fea905 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleWebhookNotificationObject.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleWebhookNotificationObject.ps1 @@ -23,7 +23,7 @@ Create an in-memory object for WebhookNotification. New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification .Notes COMPLEX PARAMETER PROPERTIES @@ -32,18 +32,17 @@ To create the parameters described below, construct a hash table containing the PROPERTY : a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleWebhookNotificationObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalewebhooknotificationobject #> function New-AzAutoscaleWebhookNotificationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties] # a property bag of settings. # This value can be empty. - # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, [Parameter()] @@ -60,6 +59,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -88,6 +90,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 index fe4a7381fe33..f6b987f50b94 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -16,16 +16,16 @@ <# .Synopsis -get predictive autoscale metric future data +Get predictive autoscale metric future data .Description -get predictive autoscale metric future data +Get predictive autoscale metric future data .Example Get-AzAutoscalePredictiveMetric -AutoscaleSettingName test-autoscalesetting -ResourceGroupName test-group -Timespan "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z" -Aggregation "Total" -Interval ([System.TimeSpan]::New(0,60,0)) -MetricName "PercentageCPU" -MetricNamespace "Microsoft.Compute/virtualMachineScaleSets" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -40,7 +40,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azautoscalepredictivemetric #> function Get-AzAutoscalePredictiveMetric { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse])] [CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(Mandatory)] @@ -160,6 +159,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,9 +190,7 @@ begin { Get = 'Az.Autoscale.private\Get-AzAutoscalePredictiveMetric_Get'; GetViaIdentity = 'Az.Autoscale.private\Get-AzAutoscalePredictiveMetric_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -198,6 +204,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) @@ -256,7 +265,7 @@ Get-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesetting .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES @@ -271,7 +280,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azautoscalesetting #> function Get-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -302,7 +311,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -361,6 +369,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -385,9 +402,7 @@ begin { List = 'Az.Autoscale.private\Get-AzAutoscaleSetting_List'; List1 = 'Az.Autoscale.private\Get-AzAutoscaleSetting_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.Autoscale.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 { @@ -401,6 +416,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) @@ -446,9 +464,9 @@ end { <# .Synopsis -Creates or updates an autoscale setting. +Create an autoscale setting. .Description -Creates or updates an autoscale setting. +Create an autoscale setting. .Example $subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) @@ -457,111 +475,43 @@ $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "ht $notification1=New-AzAutoscaleNotificationObject -EmailCustomEmail "gu@ms.com" -EmailSendToSubscriptionAdministrator $true -EmailSendToSubscriptionCoAdministrator $true -Webhook $webhook1 New-AzAutoscaleSetting -Name test-autoscalesetting -ResourceGroupName test-group -Location westeurope -Profile $profile1 -Enabled -Notification $notification1 -PredictiveAutoscalePolicyScaleLookAheadTime ([System.TimeSpan]::New(0,5,0)) -PredictiveAutoscalePolicyScaleMode 'Enabled' -PropertiesName "test-autoscalesetting" -TargetResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter - [AutoscaleSettingName ]: The autoscale setting name. - [Id ]: Resource identity path - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [SubscriptionId ]: The ID of the target subscription. - NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. -PARAMETER : The autoscale setting resource. - Location : Resource location - Profile : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. - CapacityDefault : 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. - CapacityMaximum : 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. - CapacityMinimum : the minimum number of instances for the resource. - Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. - MetricTriggerMetricName : the name of the metric that defines what the rule monitors. - MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. - MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. - MetricTriggerTimeGrain : 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. - MetricTriggerTimeWindow : 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. - ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. - [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. - [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. - [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. - [ScaleActionValue ]: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. - [FixedDateEnd ]: the end time for the profile in ISO 8601 format. - [FixedDateStart ]: the start time for the profile in ISO 8601 format. - [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. - [ScheduleTimeZone ]: 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 - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. - [Tag ]: Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. - [(Any) ]: This indicates any property can be added to this object. - [Enabled ]: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. - [Notification ]: the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. - [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. - [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. - [Property ]: a property bag of settings. This value can be empty. - [(Any) ]: This indicates any property can be added to this object. - [ServiceUri ]: the service address to receive the notification. - [PredictiveAutoscalePolicyScaleLookAheadTime ]: the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format. - [PredictiveAutoscalePolicyScaleMode ]: the predictive autoscale mode - [PropertiesName ]: the name of the autoscale setting. - [TargetResourceLocation ]: the location of the resource that the autoscale setting should be added to. - [TargetResourceUri ]: the resource identifier of the resource that the autoscale setting should be added to. - PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. CapacityDefault : 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. CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -569,46 +519,39 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azautoscalesetting #> function New-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] -[CmdletBinding(DefaultParameterSetName='CreateViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(Mandatory)] [Alias('AutoscaleSettingName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The autoscale setting name. ${Name}, - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='CreateExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] @@ -618,10 +561,9 @@ param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. - # To construct, see NOTES section for PROFILE properties and create a hash table. ${Profile}, [Parameter(ParameterSetName='CreateExpanded')] @@ -635,9 +577,8 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. - # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, [Parameter(ParameterSetName='CreateExpanded')] @@ -648,9 +589,9 @@ param( ${PredictiveAutoscalePolicyScaleLookAheadTime}, [Parameter(ParameterSetName='CreateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, @@ -662,7 +603,7 @@ param( [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags]))] [System.Collections.Hashtable] # Gets or sets a list of key value pairs that describe the resource. # These tags can be used in viewing and grouping this resource (across resource groups). @@ -682,12 +623,17 @@ param( # the resource identifier of the resource that the autoscale setting should be added to. ${TargetResourceUri}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource] - # The autoscale setting resource. - # To construct, see NOTES section for PARAMETER properties and create a hash table. - ${Parameter}, + [System.String] + # Json string supplied to the Create operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -745,6 +691,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -765,11 +720,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateExpanded'; - CreateViaIdentity = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateViaIdentity'; + CreateViaJsonFilePath = 'Az.Autoscale.private\New-AzAutoscaleSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Autoscale.private\New-AzAutoscaleSetting_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.Autoscale.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 { @@ -783,6 +737,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) @@ -880,7 +837,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -945,6 +901,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -967,9 +932,7 @@ begin { Delete = 'Az.Autoscale.private\Remove-AzAutoscaleSetting_Delete'; DeleteViaIdentity = 'Az.Autoscale.private\Remove-AzAutoscaleSetting_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.Autoscale.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 { @@ -983,6 +946,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) @@ -1036,7 +1002,7 @@ $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "ht New-AzAutoscaleNotificationObject -EmailCustomEmail "gu@ms.com" -EmailSendToSubscriptionAdministrator $true -EmailSendToSubscriptionCoAdministrator $true -Webhook $webhook1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification .Notes COMPLEX PARAMETER PROPERTIES @@ -1047,10 +1013,10 @@ WEBHOOK : the collection of webhook notifications. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleNotificationObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalenotificationobject #> function New-AzAutoscaleNotificationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -1074,9 +1040,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification[]] # the collection of webhook notifications. - # To construct, see NOTES section for WEBHOOK properties and create a hash table. ${Webhook} ) @@ -1087,6 +1052,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1115,6 +1083,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) @@ -1169,7 +1140,7 @@ $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile .Notes COMPLEX PARAMETER PROPERTIES @@ -1178,28 +1149,28 @@ To create the parameters described below, construct a hash table containing the RULE : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. [ScaleActionValue ]: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleProfileObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscaleprofileobject #> function New-AzAutoscaleProfileObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1230,10 +1201,9 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule[]] # the collection of rules that provide the triggers and parameters for the scaling action. # A maximum of 10 rules can be specified. - # To construct, see NOTES section for RULE properties and create a hash table. ${Rule}, [Parameter()] @@ -1265,9 +1235,9 @@ param( ${FixedDateTimeZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency] + [System.String] # 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. @@ -1319,6 +1289,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1347,6 +1320,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) @@ -1399,12 +1375,12 @@ Create an in-memory object for ScaleRuleMetricDimension. New-AzAutoscaleScaleRuleMetricDimensionObject -DimensionName VMName -Operator 'Equals' -Value test-vm .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleMetricDimensionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescalerulemetricdimensionobject #> function New-AzAutoscaleScaleRuleMetricDimensionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1414,9 +1390,9 @@ param( ${DimensionName}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType] + [System.String] # the dimension operator. # Only 'Equals' and 'NotEquals' are supported. # 'Equals' being equal to any of the values. @@ -1438,6 +1414,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1466,6 +1445,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) @@ -1519,7 +1501,7 @@ $subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule .Notes COMPLEX PARAMETER PROPERTIES @@ -1527,13 +1509,13 @@ To create the parameters described below, construct a hash table containing the METRICTRIGGERDIMENSION : List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescaleruleobject #> function New-AzAutoscaleScaleRuleObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1549,16 +1531,16 @@ param( ${MetricTriggerMetricResourceUri}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType] + [System.String] # the operator that is used to compare the metric data and the threshold. ${MetricTriggerOperator}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType] + [System.String] # the metric statistic type. # How the metrics from multiple instances are combined. ${MetricTriggerStatistic}, @@ -1570,9 +1552,9 @@ param( ${MetricTriggerThreshold}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType] + [System.String] # time aggregation type. # How the data that is collected should be combined over time. # The default value is Average. @@ -1602,26 +1584,25 @@ param( ${ScaleActionCooldown}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection] + [System.String] # the scale direction. # Whether the scaling action increases or decreases the number of instances. ${ScaleActionDirection}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType] + [System.String] # the type of action that should occur when the scale rule fires. ${ScaleActionType}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension[]] # List of dimension conditions. # For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - # To construct, see NOTES section for METRICTRIGGERDIMENSION properties and create a hash table. ${MetricTriggerDimension}, [Parameter()] @@ -1658,6 +1639,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1686,6 +1670,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) @@ -1738,7 +1725,7 @@ Create an in-memory object for WebhookNotification. New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification .Notes COMPLEX PARAMETER PROPERTIES @@ -1747,18 +1734,17 @@ To create the parameters described below, construct a hash table containing the PROPERTY : a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleWebhookNotificationObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalewebhooknotificationobject #> function New-AzAutoscaleWebhookNotificationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties] # a property bag of settings. # This value can be empty. - # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, [Parameter()] @@ -1775,6 +1761,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1803,6 +1792,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) @@ -1859,48 +1851,48 @@ Update-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesett .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [AutoscaleSettingName ]: The autoscale setting name. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SubscriptionId ]: The ID of the target subscription. -NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. +NOTIFICATION : the collection of notifications. To construct, see NOTES section for NOTIFICATION properties and create a hash table. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. -PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. +PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. To construct, see NOTES section for PROFILE properties and create a hash table. CapacityDefault : 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. CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -1908,16 +1900,16 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/update-azAutoscaleSetting #> function Update-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -1959,7 +1951,7 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, @@ -1972,16 +1964,16 @@ param( ${PredictiveAutoscalePolicyScaleLookAheadTime}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. # To construct, see NOTES section for PROFILE properties and create a hash table. @@ -1989,7 +1981,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -2061,6 +2053,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2083,9 +2084,7 @@ begin { UpdateExpanded = 'Az.Autoscale.custom\Update-AzAutoscaleSetting'; UpdateViaIdentityExpanded = 'Az.Autoscale.custom\Update-AzAutoscaleSetting'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -2099,6 +2098,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/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 index 8ceea9496e34..9905f5bd8f38 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 @@ -68,7 +68,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -155,9 +163,7 @@ begin { Delete = 'Az.Autoscale.private\Remove-AzAutoscaleSetting_Delete'; DeleteViaIdentity = 'Az.Autoscale.private\Remove-AzAutoscaleSetting_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.Autoscale.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 { @@ -171,6 +177,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/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 index 9b14c9985d12..ae9ddbcae8e7 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 @@ -27,48 +27,48 @@ Update-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesett .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table. [AutoscaleSettingName ]: The autoscale setting name. [Id ]: Resource identity path [ResourceGroupName ]: The name of the resource group. The name is case insensitive. [SubscriptionId ]: The ID of the target subscription. -NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. +NOTIFICATION : the collection of notifications. To construct, see NOTES section for NOTIFICATION properties and create a hash table. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. -PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. +PROFILE : the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. To construct, see NOTES section for PROFILE properties and create a hash table. CapacityDefault : 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. CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -76,16 +76,16 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/update-azAutoscaleSetting #> function Update-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -127,7 +127,7 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, @@ -140,16 +140,16 @@ param( ${PredictiveAutoscalePolicyScaleLookAheadTime}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. # To construct, see NOTES section for PROFILE properties and create a hash table. @@ -157,7 +157,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -229,6 +229,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -251,9 +260,7 @@ begin { UpdateExpanded = 'Az.Autoscale.custom\Update-AzAutoscaleSetting'; UpdateViaIdentityExpanded = 'Az.Autoscale.custom\Update-AzAutoscaleSetting'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -267,6 +274,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/Autoscale.Autorest/generate-info.json b/generated/Monitor/Autoscale.Autorest/generate-info.json index 97d2a5915591..04ae1706fe04 100644 --- a/generated/Monitor/Autoscale.Autorest/generate-info.json +++ b/generated/Monitor/Autoscale.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "4dc0c7be-517b-4e7e-919e-a967cc2b9ae2" + "generate_Id": "47241ba7-acf0-4f0f-8719-bcba7287d058" } diff --git a/generated/Monitor/Autoscale.Autorest/generated/Module.cs b/generated/Monitor/Autoscale.Autorest/generated/Module.cs index c8ccac39abeb..5302834f6cde 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/Module.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale"; + 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.Autoscale"; + 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.Autoscale.Runtime.HttpPipeline /// 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/Autoscale.Autorest/generated/api/Autoscale.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Autoscale.cs index 2193676b8ddb..e9782160868c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Autoscale.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Autoscale.cs @@ -13,10 +13,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale public partial class Autoscale { - /// Creates or updates an autoscale setting. + /// update an autoscale setting. + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// Parameters supplied to the 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). @@ -24,10 +24,11 @@ public partial class Autoscale /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsCreateOrUpdate(string resourceGroupName, string autoscaleSettingName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -54,15 +55,15 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.AutoscaleSettingsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Creates or updates an autoscale setting. + /// update an autoscale setting. /// /// Parameters supplied to the operation. /// a delegate that is called when the remote service returns 200 (OK). @@ -71,10 +72,11 @@ public partial class Autoscale /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -89,9 +91,66 @@ public partial class Autoscale } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/autoscalesettings/" + + autoscaleSettingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AutoscaleSettingsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update an autoscale setting. + /// + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)$", 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.Insights/autoscalesettings/{autoscaleSettingName}'"); + } + + // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -104,6 +163,55 @@ public partial class Autoscale + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update an autoscale setting. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Json string supplied to the AutoscaleSettingsCreateOrUpdate 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.Autoscale.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 AutoscaleSettingsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string autoscaleSettingName, 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -113,15 +221,176 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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(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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.AutoscaleSettingsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// update an autoscale setting. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Json string supplied to the AutoscaleSettingsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update an autoscale setting. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsCreateOrUpdateWithResult_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.Autoscale.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 AutoscaleSettingsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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 201 (Created). @@ -132,7 +401,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdate_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdate_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -143,6 +412,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -150,19 +420,19 @@ public partial class Autoscale case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -181,33 +451,33 @@ public partial class Autoscale /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// Parameters supplied to the operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdate_Validate(string resourceGroupName, string autoscaleSettingName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(autoscaleSettingName),autoscaleSettingName); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// Deletes and autoscale setting + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -217,7 +487,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsDelete(string resourceGroupName, string autoscaleSettingName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsDelete(string subscriptionId, string resourceGroupName, string autoscaleSettingName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -244,7 +514,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AutoscaleSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -259,7 +529,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -274,9 +544,9 @@ public partial class Autoscale } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -298,11 +568,11 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AutoscaleSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -313,7 +583,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -324,6 +594,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -343,7 +614,7 @@ public partial class Autoscale default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -362,30 +633,30 @@ public partial class Autoscale /// Validation method for method. Call this like the actual call, but you will get /// validation events back. /// + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsDelete_Validate(string resourceGroupName, string autoscaleSettingName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsDelete_Validate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(autoscaleSettingName),autoscaleSettingName); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); } } /// Gets an autoscale setting + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -394,7 +665,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsGet(string resourceGroupName, string autoscaleSettingName, 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsGet(string subscriptionId, string resourceGroupName, string autoscaleSettingName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -421,7 +692,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -435,7 +706,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsGetViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsGetViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -450,9 +721,9 @@ public partial class Autoscale } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -474,46 +745,199 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsGet_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). + /// Gets an autoscale setting + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsGet_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { + var apiVersion = @"2022-10-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)$", 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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Insights/autoscalesettings/{autoscaleSettingName}'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/autoscalesettings/" + + autoscaleSettingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets an autoscale setting + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsGetWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsGetWithResult_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.Autoscale.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 AutoscaleSettingsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.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 AutoscaleSettingsGet_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } } } @@ -531,29 +955,29 @@ public partial class Autoscale /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// The ID of the target subscription. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsGet_Validate(string resourceGroupName, string autoscaleSettingName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsGet_Validate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(autoscaleSettingName),autoscaleSettingName); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); } } /// Lists the autoscale settings for a resource group - /// The name of the resource group. The name is case insensitive. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -562,7 +986,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup(string resourceGroupName, 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -588,7 +1012,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } @@ -602,7 +1026,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroupViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroupViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -617,8 +1041,8 @@ public partial class Autoscale } // replace URI parameters with values from identity - var resourceGroupName = _match.Groups["resourceGroupName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -639,12 +1063,162 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the autoscale settings for a resource group + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings$", 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.Insights/autoscalesettings'"); + } + + // 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.Insights/autoscalesettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the autoscale settings for a 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.Autoscale.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 AutoscaleSettingsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsListByResourceGroupWithResult_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.Autoscale.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 AutoscaleSettingsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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). @@ -655,7 +1229,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -666,6 +1240,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -673,13 +1248,13 @@ public partial class Autoscale case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -698,21 +1273,21 @@ public partial class Autoscale /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// - /// The name of the resource group. The name is case insensitive. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); } } @@ -726,7 +1301,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscription(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscription(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -750,7 +1325,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -764,7 +1339,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscriptionViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscriptionViaIdentity(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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -798,11 +1373,157 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the autoscale settings for a subscription + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings'"); + } + + // 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.Insights/autoscalesettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the autoscale settings for a subscription + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/autoscalesettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// 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.Autoscale.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 AutoscaleSettingsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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 @@ -812,7 +1533,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscription_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsListBySubscription_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -823,6 +1544,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -830,13 +1552,13 @@ public partial class Autoscale case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -870,12 +1592,183 @@ public partial class Autoscale } /// - /// Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Parameters supplied to the 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.Autoscale.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 AutoscaleSettingsUpdate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AutoscaleSettingsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// + /// + /// Parameters supplied to the 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.Autoscale.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 AutoscaleSettingsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)$", 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.Insights/autoscalesettings/{autoscaleSettingName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/autoscalesettings/" + + autoscaleSettingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AutoscaleSettingsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// + /// + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)$", 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.Insights/autoscalesettings/{autoscaleSettingName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/autoscalesettings/" + + autoscaleSettingName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The autoscale setting name. - /// Parameters supplied to the operation. + /// Json string supplied to the AutoscaleSettingsUpdate 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). @@ -884,7 +1777,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsUpdate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string autoscaleSettingName, 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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -911,75 +1804,172 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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(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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AutoscaleSettingsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AutoscaleSettingsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. /// - /// - /// Parameters supplied to the 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). + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Json string supplied to the AutoscaleSettingsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AutoscaleSettingsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AutoscaleSettingsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)$", 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.Insights/autoscalesettings/{autoscaleSettingName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // 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.Autoscale.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AutoscaleSettingsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 AutoscaleSettingsUpdateWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourcegroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/autoscalesettings/" - + autoscaleSettingName + + global::System.Uri.EscapeDataString(autoscaleSettingName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AutoscaleSettingsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.AutoscaleSettingsUpdateWithResult_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.Autoscale.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 AutoscaleSettingsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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 @@ -989,7 +1979,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsUpdate_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsUpdate_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1000,6 +1990,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1007,13 +1998,13 @@ public partial class Autoscale case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1040,7 +2031,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AutoscaleSettingsUpdate_Validate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AutoscaleSettingsUpdate_Validate(string subscriptionId, string resourceGroupName, string autoscaleSettingName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1073,7 +2064,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PredictiveMetricGet(string subscriptionId, string resourceGroupName, string autoscaleSettingName, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PredictiveMetricGet(string subscriptionId, string resourceGroupName, string autoscaleSettingName, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -1111,7 +2102,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PredictiveMetricGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PredictiveMetricGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1131,7 +2122,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PredictiveMetricGetViaIdentity(global::System.String viaIdentity, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PredictiveMetricGetViaIdentity(global::System.String viaIdentity, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { var apiVersion = @"2022-10-01"; // Constant Parameters @@ -1181,11 +2172,197 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PredictiveMetricGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PredictiveMetricGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// get predictive autoscale metric future data + /// + /// The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + /// The interval (i.e. timegrain) of the query. + /// Metric namespace to query metric definitions for. + /// The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself + /// has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** + /// The list of aggregation types (comma separated) to retrieve. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 PredictiveMetricGetViaIdentityWithResult(global::System.String viaIdentity, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Insights/autoscalesettings/(?[^/]+)/predictiveMetrics$", 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.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var autoscaleSettingName = _match.Groups["autoscaleSettingName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/autoscalesettings/" + + autoscaleSettingName + + "/predictiveMetrics" + + "?" + + "timespan=" + global::System.Uri.EscapeDataString(timespan) + + "&" + + "interval=" + global::System.Uri.EscapeDataString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)interval)) + + "&" + + "metricNamespace=" + global::System.Uri.EscapeDataString(metricNamespace) + + "&" + + "metricName=" + global::System.Uri.EscapeDataString(metricName) + + "&" + + "aggregation=" + global::System.Uri.EscapeDataString(aggregation) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PredictiveMetricGetWithResult_Call (request, eventListener,sender); + } + } + + /// get predictive autoscale metric future data + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The autoscale setting name. + /// The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + /// The interval (i.e. timegrain) of the query. + /// Metric namespace to query metric definitions for. + /// The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself + /// has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'** + /// The list of aggregation types (comma separated) to retrieve. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 PredictiveMetricGetWithResult(string subscriptionId, string resourceGroupName, string autoscaleSettingName, string timespan, global::System.TimeSpan interval, string metricNamespace, string metricName, string aggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-10-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/autoscalesettings/" + + global::System.Uri.EscapeDataString(autoscaleSettingName) + + "/predictiveMetrics" + + "?" + + "timespan=" + global::System.Uri.EscapeDataString(timespan) + + "&" + + "interval=" + global::System.Uri.EscapeDataString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)interval)) + + "&" + + "metricNamespace=" + global::System.Uri.EscapeDataString(metricNamespace) + + "&" + + "metricName=" + global::System.Uri.EscapeDataString(metricName) + + "&" + + "aggregation=" + global::System.Uri.EscapeDataString(aggregation) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PredictiveMetricGetWithResult_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.Autoscale.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 PredictiveMetricGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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 @@ -1195,7 +2372,7 @@ public partial class Autoscale /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PredictiveMetricGet_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PredictiveMetricGet_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.Autoscale.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1206,6 +2383,7 @@ public partial class Autoscale await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1213,13 +2391,13 @@ public partial class Autoscale case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs deleted file mode 100644 index 1a4b3e96b14f..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.PowerShell.cs +++ /dev/null @@ -1,292 +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.Autoscale.Models.Api20221001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; - - /// Autoscale profile. - [System.ComponentModel.TypeConverter(typeof(AutoscaleProfileTypeConverter))] - public partial class AutoscaleProfile - { - - /// - /// 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 AutoscaleProfile(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("FixedDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDate = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow) content.GetValueForProperty("FixedDate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDate, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindowTypeConverter.ConvertFrom); - } - if (content.Contains("Recurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrenceTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("RecurrenceFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) content.GetValueForProperty("RecurrenceFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceFrequency, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency.CreateFrom); - } - if (content.Contains("CapacityMinimum")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMinimum = (string) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMinimum, global::System.Convert.ToString); - } - if (content.Contains("CapacityMaximum")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMaximum = (string) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMaximum, global::System.Convert.ToString); - } - if (content.Contains("CapacityDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityDefault = (string) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityDefault, global::System.Convert.ToString); - } - if (content.Contains("FixedDateTimeZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateTimeZone = (string) content.GetValueForProperty("FixedDateTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateTimeZone, global::System.Convert.ToString); - } - if (content.Contains("FixedDateStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FixedDateEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrenceSchedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule) content.GetValueForProperty("RecurrenceSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceSchedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleTimeZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleTimeZone, global::System.Convert.ToString); - } - if (content.Contains("ScheduleDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleDay = (string[]) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ScheduleHour")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleHour = (int[]) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); - } - if (content.Contains("ScheduleMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleMinute = (int[]) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AutoscaleProfile(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("FixedDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDate = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow) content.GetValueForProperty("FixedDate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDate, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindowTypeConverter.ConvertFrom); - } - if (content.Contains("Recurrence")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrenceTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("RecurrenceFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceFrequency = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) content.GetValueForProperty("RecurrenceFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceFrequency, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency.CreateFrom); - } - if (content.Contains("CapacityMinimum")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMinimum = (string) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMinimum, global::System.Convert.ToString); - } - if (content.Contains("CapacityMaximum")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMaximum = (string) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityMaximum, global::System.Convert.ToString); - } - if (content.Contains("CapacityDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityDefault = (string) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).CapacityDefault, global::System.Convert.ToString); - } - if (content.Contains("FixedDateTimeZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateTimeZone = (string) content.GetValueForProperty("FixedDateTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateTimeZone, global::System.Convert.ToString); - } - if (content.Contains("FixedDateStart")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FixedDateEnd")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RecurrenceSchedule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule) content.GetValueForProperty("RecurrenceSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).RecurrenceSchedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentScheduleTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleTimeZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleTimeZone, global::System.Convert.ToString); - } - if (content.Contains("ScheduleDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleDay = (string[]) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ScheduleHour")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleHour = (int[]) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); - } - if (content.Contains("ScheduleMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleMinute = (int[]) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); - } - 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.Autoscale.Models.Api20221001.IAutoscaleProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AutoscaleProfile(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.Autoscale.Models.Api20221001.IAutoscaleProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AutoscaleProfile(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.Autoscale.Models.Api20221001.IAutoscaleProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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(); - } - } - /// Autoscale profile. - [System.ComponentModel.TypeConverter(typeof(AutoscaleProfileTypeConverter))] - public partial interface IAutoscaleProfile - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.PowerShell.cs deleted file mode 100644 index 79b9f4d1b7ba..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.PowerShell.cs +++ /dev/null @@ -1,334 +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.Autoscale.Models.Api20221001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; - - /// The autoscale setting resource. - [System.ComponentModel.TypeConverter(typeof(AutoscaleSettingResourceTypeConverter))] - public partial class AutoscaleSettingResource - { - - /// - /// 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 AutoscaleSettingResource(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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("PredictiveAutoscalePolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); - } - if (content.Contains("Profile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); - } - if (content.Contains("Notification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("TargetResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceUri, global::System.Convert.ToString); - } - if (content.Contains("TargetResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("PredictiveAutoscalePolicyScaleMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); - } - if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AutoscaleSettingResource(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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("PredictiveAutoscalePolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); - } - if (content.Contains("Profile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); - } - if (content.Contains("Notification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("TargetResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceUri, global::System.Convert.ToString); - } - if (content.Contains("TargetResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).TargetResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("PredictiveAutoscalePolicyScaleMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); - } - if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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.Autoscale.Models.Api20221001.IAutoscaleSettingResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AutoscaleSettingResource(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.Autoscale.Models.Api20221001.IAutoscaleSettingResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AutoscaleSettingResource(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.Autoscale.Models.Api20221001.IAutoscaleSettingResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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 autoscale setting resource. - [System.ComponentModel.TypeConverter(typeof(AutoscaleSettingResourceTypeConverter))] - public partial interface IAutoscaleSettingResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.PowerShell.cs deleted file mode 100644 index 3db72143e21e..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.PowerShell.cs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; - - /// A rule that provide the triggers and parameters for the scaling action. - [System.ComponentModel.TypeConverter(typeof(ScaleRuleTypeConverter))] - public partial class ScaleRule - { - - /// - /// 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.Autoscale.Models.Api20221001.IScaleRule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScaleRule(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.Autoscale.Models.Api20221001.IScaleRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScaleRule(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.Autoscale.Models.Api20221001.IScaleRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScaleRule(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("MetricTrigger")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger) content.GetValueForProperty("MetricTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTrigger, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTriggerTypeConverter.ConvertFrom); - } - if (content.Contains("ScaleAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleAction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction) content.GetValueForProperty("ScaleAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleAction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleActionTypeConverter.ConvertFrom); - } - if (content.Contains("MetricTriggerMetricName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricName = (string) content.GetValueForProperty("MetricTriggerMetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricName, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerMetricNamespace")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricNamespace = (string) content.GetValueForProperty("MetricTriggerMetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricNamespace, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerTimeGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeGrain = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerTimeWindow")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeWindow = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerThreshold = (double) content.GetValueForProperty("MetricTriggerThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerThreshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - if (content.Contains("MetricTriggerDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]) content.GetValueForProperty("MetricTriggerDimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); - } - if (content.Contains("ScaleActionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionValue = (string) content.GetValueForProperty("ScaleActionValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionValue, global::System.Convert.ToString); - } - if (content.Contains("ScaleActionCooldown")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionCooldown = (global::System.TimeSpan) content.GetValueForProperty("ScaleActionCooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionCooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerMetricResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceUri = (string) content.GetValueForProperty("MetricTriggerMetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceUri, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerMetricResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation = (string) content.GetValueForProperty("MetricTriggerMetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerStatistic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerStatistic = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) content.GetValueForProperty("MetricTriggerStatistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerStatistic, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType.CreateFrom); - } - if (content.Contains("MetricTriggerTimeAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) content.GetValueForProperty("MetricTriggerTimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType.CreateFrom); - } - if (content.Contains("MetricTriggerOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerOperator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) content.GetValueForProperty("MetricTriggerOperator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerOperator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType.CreateFrom); - } - if (content.Contains("MetricTriggerDividePerInstance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDividePerInstance = (bool?) content.GetValueForProperty("MetricTriggerDividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ScaleActionDirection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionDirection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) content.GetValueForProperty("ScaleActionDirection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionDirection, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection.CreateFrom); - } - if (content.Contains("ScaleActionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) content.GetValueForProperty("ScaleActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ScaleRule(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("MetricTrigger")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger) content.GetValueForProperty("MetricTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTrigger, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTriggerTypeConverter.ConvertFrom); - } - if (content.Contains("ScaleAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleAction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction) content.GetValueForProperty("ScaleAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleAction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleActionTypeConverter.ConvertFrom); - } - if (content.Contains("MetricTriggerMetricName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricName = (string) content.GetValueForProperty("MetricTriggerMetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricName, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerMetricNamespace")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricNamespace = (string) content.GetValueForProperty("MetricTriggerMetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricNamespace, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerTimeGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeGrain = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerTimeWindow")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeWindow = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerThreshold = (double) content.GetValueForProperty("MetricTriggerThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerThreshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - if (content.Contains("MetricTriggerDimension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]) content.GetValueForProperty("MetricTriggerDimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); - } - if (content.Contains("ScaleActionValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionValue = (string) content.GetValueForProperty("ScaleActionValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionValue, global::System.Convert.ToString); - } - if (content.Contains("ScaleActionCooldown")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionCooldown = (global::System.TimeSpan) content.GetValueForProperty("ScaleActionCooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionCooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("MetricTriggerMetricResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceUri = (string) content.GetValueForProperty("MetricTriggerMetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceUri, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerMetricResourceLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation = (string) content.GetValueForProperty("MetricTriggerMetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation, global::System.Convert.ToString); - } - if (content.Contains("MetricTriggerStatistic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerStatistic = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) content.GetValueForProperty("MetricTriggerStatistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerStatistic, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType.CreateFrom); - } - if (content.Contains("MetricTriggerTimeAggregation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) content.GetValueForProperty("MetricTriggerTimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerTimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType.CreateFrom); - } - if (content.Contains("MetricTriggerOperator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerOperator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) content.GetValueForProperty("MetricTriggerOperator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerOperator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType.CreateFrom); - } - if (content.Contains("MetricTriggerDividePerInstance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDividePerInstance = (bool?) content.GetValueForProperty("MetricTriggerDividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).MetricTriggerDividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ScaleActionDirection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionDirection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) content.GetValueForProperty("ScaleActionDirection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionDirection, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection.CreateFrom); - } - if (content.Contains("ScaleActionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) content.GetValueForProperty("ScaleActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal)this).ScaleActionType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType.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.Autoscale.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(); - } - } - /// A rule that provide the triggers and parameters for the scaling action. - [System.ComponentModel.TypeConverter(typeof(ScaleRuleTypeConverter))] - public partial interface IScaleRule - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.PowerShell.cs similarity index 53% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.PowerShell.cs index 6df518a6e54f..c07fd075e037 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleErrorResponse 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,57 +78,57 @@ internal AutoscaleErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)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.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)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("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Detail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Detail, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)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.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)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. @@ -143,79 +143,77 @@ internal AutoscaleErrorResponse(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)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.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)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("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).Detail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).Detail, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal)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.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleErrorResponse(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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleErrorResponse(content); } @@ -225,7 +223,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.TypeConverter.cs index 82d4524e1c46..6783fcad41fc 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.cs similarity index 57% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.cs index df6b6d7be849..8d4dc1c7d4c4 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.cs @@ -3,75 +3,93 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Describes the format of Error response. public partial class AutoscaleErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal { /// One of a server-defined set of error codes. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Code = value ?? null; } /// A human-readable representation of the error's details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Detail = value ?? null; } + public string Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Detail = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError _error; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError _error; /// The error object. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseError()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseError()); set => this._error = value; } /// A human-readable representation of the error. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseError()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseError()); set { {_error = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData _systemData; /// The system metadata related to the response. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// The target of the particular error. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)Error).Target = value ?? null; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)Error).Target = value ?? null; } /// Creates an new instance. public AutoscaleErrorResponse() @@ -87,6 +105,9 @@ public partial interface IAutoscaleErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"One of a server-defined set of error codes.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +116,9 @@ public partial interface IAutoscaleErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A human-readable representation of the error's details.", SerializedName = @"details", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +127,9 @@ public partial interface IAutoscaleErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A human-readable representation of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -110,55 +137,78 @@ public partial interface IAutoscaleErrorResponse : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// The target of the particular error. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -174,23 +224,25 @@ internal partial interface IAutoscaleErrorResponseInternal /// A human-readable representation of the error's details. string Detail { get; set; } /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError Error { get; set; } /// A human-readable representation of the error. string Message { get; set; } /// The system metadata related to the response. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// The target of the particular error. string Target { get; set; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.json.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.json.cs index 733e6bb9a76f..6089314d1755 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponse.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AutoscaleErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autos { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleErrorResponseError.FromJson(__jsonError) : Error;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleErrorResponseError.FromJson(__jsonError) : _error;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleErrorResponse(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNod return container; } AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.PowerShell.cs similarity index 72% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.PowerShell.cs index 83ba5b40c087..57f1a125aef2 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleErrorResponseError 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,25 +78,25 @@ internal AutoscaleErrorResponseError(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Detail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Detail, 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. @@ -111,47 +111,45 @@ internal AutoscaleErrorResponseError(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal)this).Detail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Detail = (string) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal)this).Detail, 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.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleErrorResponseError(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.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleErrorResponseError(content); } @@ -161,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.TypeConverter.cs index 9115280c2423..4ed39b437aa5 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.cs similarity index 93% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.cs index ad7366469c6c..1a2a771db5f7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The error object. public partial class AutoscaleErrorResponseError : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseErrorInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IAutoscaleErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"One of a server-defined set of error codes.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IAutoscaleErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A human-readable representation of the error's details.", SerializedName = @"details", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IAutoscaleErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A human-readable representation of the error.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IAutoscaleErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.json.cs similarity index 93% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.json.cs index 83924fce1110..d39a82a69ae8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleErrorResponseError.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleErrorResponseError.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AutoscaleErrorResponseError(Microsoft.Azure.PowerShell.Cmdlets.Monitor. { 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) ? (string)__jsonDetails : (string)Detail;} + {_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) ? (string)__jsonDetails : (string)_detail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleErrorResponseError(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.PowerShell.cs index bc52cf355852..5dcbcfeb596b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.PowerShell.cs @@ -75,14 +75,14 @@ internal AutoscaleIdentity(global::System.Collections.IDictionary content) return; } // actually deserialize - if (content.Contains("ResourceGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); - } if (content.Contains("SubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } if (content.Contains("AutoscaleSettingName")) { ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).AutoscaleSettingName = (string) content.GetValueForProperty("AutoscaleSettingName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).AutoscaleSettingName, global::System.Convert.ToString); @@ -108,14 +108,14 @@ internal AutoscaleIdentity(global::System.Management.Automation.PSObject content return; } // actually deserialize - if (content.Contains("ResourceGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); - } if (content.Contains("SubscriptionId")) { ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } if (content.Contains("AutoscaleSettingName")) { ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).AutoscaleSettingName = (string) content.GetValueForProperty("AutoscaleSettingName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentityInternal)this).AutoscaleSettingName, global::System.Convert.ToString); diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.cs index 3a79da23436f..45ef3882324f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.cs @@ -53,6 +53,9 @@ public partial interface IAutoscaleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The autoscale setting name.", SerializedName = @"autoscaleSettingName", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IAutoscaleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 IAutoscaleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 IAutoscaleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.json.cs index 8fb340f7cc27..40f61b71cfe5 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleIdentity.json.cs @@ -64,10 +64,10 @@ internal AutoscaleIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale. { return; } - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_autoscaleSettingName = If( json?.PropertyT("autoscaleSettingName"), out var __jsonAutoscaleSettingName) ? (string)__jsonAutoscaleSettingName : (string)AutoscaleSettingName;} - {_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;} + {_autoscaleSettingName = If( json?.PropertyT("autoscaleSettingName"), out var __jsonAutoscaleSettingName) ? (string)__jsonAutoscaleSettingName : (string)_autoscaleSettingName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } @@ -102,8 +102,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNod { return container; } - AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); AddIf( null != (((object)this._autoscaleSettingName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._autoscaleSettingName.ToString()) : null, "autoscaleSettingName" ,container.Add ); AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); AfterToJson(ref container); diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.PowerShell.cs similarity index 61% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.PowerShell.cs index 88c8af5f289b..b967547820b3 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleNotification 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,33 +78,33 @@ internal AutoscaleNotification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Email = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Email, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Email = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Email, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotificationTypeConverter.ConvertFrom); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Webhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Webhook = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[]) content.GetValueForProperty("Webhook",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Webhook, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Webhook = (System.Collections.Generic.List) content.GetValueForProperty("Webhook",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Webhook, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationTypeConverter.ConvertFrom)); } if (content.Contains("EmailSendToSubscriptionAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EmailSendToSubscriptionCoAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EmailCustomEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailCustomEmail = (string[]) content.GetValueForProperty("EmailCustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailCustomEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailCustomEmail = (System.Collections.Generic.List) content.GetValueForProperty("EmailCustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailCustomEmail, __y => TypeConverterExtensions.SelectToList(__y, 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. @@ -119,55 +119,53 @@ internal AutoscaleNotification(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Email = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Email, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Email = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Email, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotificationTypeConverter.ConvertFrom); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Webhook")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Webhook = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[]) content.GetValueForProperty("Webhook",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).Webhook, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Webhook = (System.Collections.Generic.List) content.GetValueForProperty("Webhook",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).Webhook, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationTypeConverter.ConvertFrom)); } if (content.Contains("EmailSendToSubscriptionAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EmailSendToSubscriptionCoAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("EmailSendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailSendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EmailCustomEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailCustomEmail = (string[]) content.GetValueForProperty("EmailCustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal)this).EmailCustomEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailCustomEmail = (System.Collections.Generic.List) content.GetValueForProperty("EmailCustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal)this).EmailCustomEmail, __y => TypeConverterExtensions.SelectToList(__y, 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.Autoscale.Models.Api20221001.IAutoscaleNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleNotification(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.Autoscale.Models.Api20221001.IAutoscaleNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleNotification(content); } @@ -177,7 +175,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.TypeConverter.cs index 540596b23ab1..5591764faed9 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleNotification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.cs similarity index 71% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.cs index 59412fa34be7..f476bad01a26 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.cs @@ -3,42 +3,42 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Autoscale notification. public partial class AutoscaleNotification : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification _email; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification _email; /// the email notification. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification Email { get => (this._email = this._email ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotification()); set => this._email = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification Email { get => (this._email = this._email ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotification()); set => this._email = value; } /// /// the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string[] EmailCustomEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).CustomEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).CustomEmail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List EmailCustomEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).CustomEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).CustomEmail = value ?? null /* arrayOf */; } /// a value indicating whether to send email to subscription administrator. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public bool? EmailSendToSubscriptionAdministrator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).SendToSubscriptionAdministrator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).SendToSubscriptionAdministrator = value ?? default(bool); } + public bool? EmailSendToSubscriptionAdministrator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).SendToSubscriptionAdministrator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).SendToSubscriptionAdministrator = value ?? default(bool); } /// a value indicating whether to send email to subscription co-administrators. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public bool? EmailSendToSubscriptionCoAdministrator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).SendToSubscriptionCoAdministrator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)Email).SendToSubscriptionCoAdministrator = value ?? default(bool); } + public bool? EmailSendToSubscriptionCoAdministrator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).SendToSubscriptionCoAdministrator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)Email).SendToSubscriptionCoAdministrator = value ?? default(bool); } /// Internal Acessors for Email - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal.Email { get => (this._email = this._email ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotification()); set { {_email = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal.Email { get => (this._email = this._email ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotification()); set { {_email = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotificationInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotificationInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Backing field for property. private string _operation= @"Scale"; @@ -48,11 +48,11 @@ public partial class AutoscaleNotification : public string Operation { get => this._operation; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[] _webhook; + private System.Collections.Generic.List _webhook; /// the collection of webhook notifications. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[] Webhook { get => this._webhook; set => this._webhook = value; } + public System.Collections.Generic.List Webhook { get => this._webhook; set => this._webhook = value; } /// Creates an new instance. public AutoscaleNotification() @@ -70,14 +70,20 @@ public partial interface IAutoscaleNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored.", SerializedName = @"customEmails", PossibleTypes = new [] { typeof(string) })] - string[] EmailCustomEmail { get; set; } + System.Collections.Generic.List EmailCustomEmail { get; set; } /// a value indicating whether to send email to subscription administrator. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether to send email to subscription administrator.", SerializedName = @"sendToSubscriptionAdministrator", PossibleTypes = new [] { typeof(bool) })] @@ -86,6 +92,9 @@ public partial interface IAutoscaleNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether to send email to subscription co-administrators.", SerializedName = @"sendToSubscriptionCoAdministrators", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +103,9 @@ public partial interface IAutoscaleNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = true, + Read = true, + Create = true, + Update = true, Description = @"the operation associated with the notification and its value must be ""scale""", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -102,10 +114,13 @@ public partial interface IAutoscaleNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of webhook notifications.", SerializedName = @"webhooks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[] Webhook { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification) })] + System.Collections.Generic.List Webhook { get; set; } } /// Autoscale notification. @@ -113,11 +128,11 @@ internal partial interface IAutoscaleNotificationInternal { /// the email notification. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification Email { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification Email { get; set; } /// /// the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. /// - string[] EmailCustomEmail { get; set; } + System.Collections.Generic.List EmailCustomEmail { get; set; } /// a value indicating whether to send email to subscription administrator. bool? EmailSendToSubscriptionAdministrator { get; set; } /// a value indicating whether to send email to subscription co-administrators. @@ -125,7 +140,7 @@ internal partial interface IAutoscaleNotificationInternal /// the operation associated with the notification and its value must be "scale" string Operation { get; set; } /// the collection of webhook notifications. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[] Webhook { get; set; } + System.Collections.Generic.List Webhook { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.json.cs similarity index 90% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.json.cs index 4b66eb2c2170..ea5519ea573e 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleNotification.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AutoscaleNotification(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autosc { return; } - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.EmailNotification.FromJson(__jsonEmail) : Email;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_webhook = If( json?.PropertyT("webhooks"), out var __jsonWebhooks) ? If( __jsonWebhooks as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IWebhookNotification) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotification.FromJson(__u) )) ))() : null : Webhook;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.EmailNotification.FromJson(__jsonEmail) : _email;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_webhook = If( json?.PropertyT("webhooks"), out var __jsonWebhooks) ? If( __jsonWebhooks as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IWebhookNotification) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotification.FromJson(__u) )) ))() : null : _webhook;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleNotification(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.PowerShell.cs new file mode 100644 index 000000000000..e287e4d6539f --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.PowerShell.cs @@ -0,0 +1,292 @@ +// 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.Autoscale.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + + /// Autoscale profile. + [System.ComponentModel.TypeConverter(typeof(AutoscaleProfileTypeConverter))] + public partial class AutoscaleProfile + { + + /// + /// 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 AutoscaleProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("FixedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDate = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow) content.GetValueForProperty("FixedDate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDate, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindowTypeConverter.ConvertFrom); + } + if (content.Contains("Recurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrenceTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RecurrenceFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceFrequency = (string) content.GetValueForProperty("RecurrenceFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceFrequency, global::System.Convert.ToString); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMinimum = (string) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMinimum, global::System.Convert.ToString); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMaximum = (string) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMaximum, global::System.Convert.ToString); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityDefault = (string) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityDefault, global::System.Convert.ToString); + } + if (content.Contains("FixedDateTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateTimeZone = (string) content.GetValueForProperty("FixedDateTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateTimeZone, global::System.Convert.ToString); + } + if (content.Contains("FixedDateStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FixedDateEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrenceSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule) content.GetValueForProperty("RecurrenceSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceSchedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleTimeZone, global::System.Convert.ToString); + } + if (content.Contains("ScheduleDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleDay = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ScheduleHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleHour = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("ScheduleMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleMinute = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AutoscaleProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("FixedDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDate = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow) content.GetValueForProperty("FixedDate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDate, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindowTypeConverter.ConvertFrom); + } + if (content.Contains("Recurrence")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Recurrence = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence) content.GetValueForProperty("Recurrence",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Recurrence, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrenceTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RecurrenceFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceFrequency = (string) content.GetValueForProperty("RecurrenceFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceFrequency, global::System.Convert.ToString); + } + if (content.Contains("CapacityMinimum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMinimum = (string) content.GetValueForProperty("CapacityMinimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMinimum, global::System.Convert.ToString); + } + if (content.Contains("CapacityMaximum")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMaximum = (string) content.GetValueForProperty("CapacityMaximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityMaximum, global::System.Convert.ToString); + } + if (content.Contains("CapacityDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityDefault = (string) content.GetValueForProperty("CapacityDefault",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).CapacityDefault, global::System.Convert.ToString); + } + if (content.Contains("FixedDateTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateTimeZone = (string) content.GetValueForProperty("FixedDateTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateTimeZone, global::System.Convert.ToString); + } + if (content.Contains("FixedDateStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateStart = (global::System.DateTime?) content.GetValueForProperty("FixedDateStart",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateStart, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FixedDateEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateEnd = (global::System.DateTime?) content.GetValueForProperty("FixedDateEnd",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).FixedDateEnd, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RecurrenceSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule) content.GetValueForProperty("RecurrenceSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).RecurrenceSchedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentScheduleTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleTimeZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleTimeZone, global::System.Convert.ToString); + } + if (content.Contains("ScheduleDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleDay = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ScheduleHour")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleHour = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + if (content.Contains("ScheduleMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleMinute = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + } + 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.Autoscale.Models.IAutoscaleProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AutoscaleProfile(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.Autoscale.Models.IAutoscaleProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AutoscaleProfile(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.Autoscale.Models.IAutoscaleProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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(); + } + } + /// Autoscale profile. + [System.ComponentModel.TypeConverter(typeof(AutoscaleProfileTypeConverter))] + public partial interface IAutoscaleProfile + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.TypeConverter.cs index 505ea81cee72..eeb33849bf52 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.cs similarity index 84% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.cs index fce072c1924d..fccef7805422 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.cs @@ -3,57 +3,57 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Autoscale profile. public partial class AutoscaleProfile : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity _capacity; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity _capacity; /// the number of instances that can be used during this profile. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacity()); set => this._capacity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacity()); set => this._capacity = value; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Default = value ; } + public string CapacityDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Default; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Default = value ; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Maximum = value ; } + public string CapacityMaximum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Maximum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Maximum = value ; } /// the minimum number of instances for the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)Capacity).Minimum = value ; } + public string CapacityMinimum { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Minimum; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)Capacity).Minimum = value ; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow _fixedDate; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow _fixedDate; /// /// the specific date-time for the profile. This element is not used if the Recurrence element is used. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow FixedDate { get => (this._fixedDate = this._fixedDate ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindow()); set => this._fixedDate = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow FixedDate { get => (this._fixedDate = this._fixedDate ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindow()); set => this._fixedDate = value; } /// the end time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? FixedDateEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).End = value ?? default(global::System.DateTime); } + public global::System.DateTime? FixedDateEnd { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).End; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).End = value ?? default(global::System.DateTime); } /// the start time for the profile in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? FixedDateStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).Start = value ?? default(global::System.DateTime); } + public global::System.DateTime? FixedDateStart { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).Start; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).Start = value ?? default(global::System.DateTime); } /// /// the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, @@ -81,19 +81,19 @@ public partial class AutoscaleProfile : /// Time, Line Islands Standard Time /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string FixedDateTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)FixedDate).TimeZone = value ?? null; } + public string FixedDateTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)FixedDate).TimeZone = value ?? null; } /// Internal Acessors for Capacity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacity()); set { {_capacity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal.Capacity { get => (this._capacity = this._capacity ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacity()); set { {_capacity = value;} } } /// Internal Acessors for FixedDate - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal.FixedDate { get => (this._fixedDate = this._fixedDate ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindow()); set { {_fixedDate = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal.FixedDate { get => (this._fixedDate = this._fixedDate ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindow()); set { {_fixedDate = value;} } } /// Internal Acessors for Recurrence - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal.Recurrence { get => (this._recurrence = this._recurrence ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Recurrence()); set { {_recurrence = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal.Recurrence { get => (this._recurrence = this._recurrence ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Recurrence()); set { {_recurrence = value;} } } /// Internal Acessors for RecurrenceSchedule - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfileInternal.RecurrenceSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).Schedule = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfileInternal.RecurrenceSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).Schedule = value ?? null /* model class */; } /// Backing field for property. private string _name; @@ -103,13 +103,13 @@ public partial class AutoscaleProfile : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence _recurrence; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence _recurrence; /// /// the repeating times at which this profile begins. This element is not used if the FixedDate element is used. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence Recurrence { get => (this._recurrence = this._recurrence ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Recurrence()); set => this._recurrence = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence Recurrence { get => (this._recurrence = this._recurrence ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Recurrence()); set => this._recurrence = value; } /// /// the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week @@ -117,34 +117,34 @@ public partial class AutoscaleProfile : /// frequency property specifies that the schedule is repeated weekly. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency? RecurrenceFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).Frequency = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency)""); } + public string RecurrenceFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).Frequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).Frequency = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[] _rule; + private System.Collections.Generic.List _rule; /// /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[] Rule { get => this._rule; set => this._rule = value; } + public System.Collections.Generic.List Rule { get => this._rule; set => this._rule = value; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string[] ScheduleDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleDay = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ScheduleDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleDay = value ?? null /* arrayOf */; } /// /// 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). /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public int[] ScheduleHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleHour = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ScheduleHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleHour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleHour = value ?? null /* arrayOf */; } /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public int[] ScheduleMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleMinute = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ScheduleMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleMinute = value ?? null /* arrayOf */; } /// /// the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian @@ -172,7 +172,7 @@ public partial class AutoscaleProfile : /// Standard Time /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string ScheduleTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleTimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)Recurrence).ScheduleTimeZone = value ?? null; } + public string ScheduleTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleTimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)Recurrence).ScheduleTimeZone = value ?? null; } /// Creates an new instance. public AutoscaleProfile() @@ -191,6 +191,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"default", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +205,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"maximum", PossibleTypes = new [] { typeof(string) })] @@ -210,6 +216,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the minimum number of instances for the resource.", SerializedName = @"minimum", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +227,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the end time for the profile in ISO 8601 format.", SerializedName = @"end", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -226,6 +238,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the start time for the profile in ISO 8601 format.", SerializedName = @"start", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -258,6 +273,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"timeZone", PossibleTypes = new [] { typeof(string) })] @@ -266,6 +284,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the profile.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -278,10 +299,14 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"frequency", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency? RecurrenceFrequency { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] + string RecurrenceFrequency { get; set; } /// /// the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be /// specified. @@ -289,20 +314,26 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[] Rule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule) })] + System.Collections.Generic.List Rule { get; set; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.", SerializedName = @"days", PossibleTypes = new [] { typeof(string) })] - string[] ScheduleDay { get; set; } + System.Collections.Generic.List ScheduleDay { get; set; } /// /// 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). @@ -310,18 +341,24 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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).", SerializedName = @"hours", PossibleTypes = new [] { typeof(int) })] - int[] ScheduleHour { get; set; } + System.Collections.Generic.List ScheduleHour { get; set; } /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of minutes at which the profile takes effect at.", SerializedName = @"minutes", PossibleTypes = new [] { typeof(int) })] - int[] ScheduleMinute { get; set; } + System.Collections.Generic.List ScheduleMinute { get; set; } /// /// 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, @@ -350,6 +387,9 @@ public partial interface IAutoscaleProfile : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"timeZone", PossibleTypes = new [] { typeof(string) })] @@ -361,7 +401,7 @@ internal partial interface IAutoscaleProfileInternal { /// the number of instances that can be used during this profile. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity Capacity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity Capacity { get; set; } /// /// 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. @@ -377,7 +417,7 @@ internal partial interface IAutoscaleProfileInternal /// /// the specific date-time for the profile. This element is not used if the Recurrence element is used. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow FixedDate { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow FixedDate { get; set; } /// the end time for the profile in ISO 8601 format. global::System.DateTime? FixedDateEnd { get; set; } /// the start time for the profile in ISO 8601 format. @@ -413,31 +453,32 @@ internal partial interface IAutoscaleProfileInternal /// /// the repeating times at which this profile begins. This element is not used if the FixedDate element is used. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence Recurrence { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence Recurrence { get; set; } /// /// 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.Support.RecurrenceFrequency? RecurrenceFrequency { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] + string RecurrenceFrequency { get; set; } /// the scheduling constraints for when the profile begins. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule RecurrenceSchedule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule RecurrenceSchedule { get; set; } /// /// 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.Api20221001.IScaleRule[] Rule { get; set; } + System.Collections.Generic.List Rule { get; set; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// - string[] ScheduleDay { get; set; } + System.Collections.Generic.List ScheduleDay { get; set; } /// /// 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 { get; set; } + System.Collections.Generic.List ScheduleHour { get; set; } /// A collection of minutes at which the profile takes effect at. - int[] ScheduleMinute { get; set; } + System.Collections.Generic.List ScheduleMinute { get; set; } /// /// 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, diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.json.cs similarity index 89% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.json.cs index b6e6e9af262c..beee97da542c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleProfile.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleProfile.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,22 +65,22 @@ internal AutoscaleProfile(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.R { return; } - {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleCapacity.FromJson(__jsonCapacity) : Capacity;} - {_fixedDate = If( json?.PropertyT("fixedDate"), out var __jsonFixedDate) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.TimeWindow.FromJson(__jsonFixedDate) : FixedDate;} - {_recurrence = If( json?.PropertyT("recurrence"), out var __jsonRecurrence) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Recurrence.FromJson(__jsonRecurrence) : Recurrence;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleRule) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule.FromJson(__u) )) ))() : null : Rule;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleCapacity.FromJson(__jsonCapacity) : _capacity;} + {_fixedDate = If( json?.PropertyT("fixedDate"), out var __jsonFixedDate) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.TimeWindow.FromJson(__jsonFixedDate) : _fixedDate;} + {_recurrence = If( json?.PropertyT("recurrence"), out var __jsonRecurrence) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Recurrence.FromJson(__jsonRecurrence) : _recurrence;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IScaleRule) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule.FromJson(__u) )) ))() : null : _rule;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleProfile(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.PowerShell.cs similarity index 55% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.PowerShell.cs index b8128dadf70b..9d817c007a9d 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AutoscaleSetting 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. @@ -80,45 +80,45 @@ internal AutoscaleSetting(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PredictiveAutoscalePolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); } if (content.Contains("Profile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); } if (content.Contains("Notification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("TargetResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceUri, global::System.Convert.ToString); } if (content.Contains("TargetResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceLocation, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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. @@ -133,65 +133,65 @@ internal AutoscaleSetting(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("PredictiveAutoscalePolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); } if (content.Contains("Profile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); } if (content.Contains("Notification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("TargetResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceUri, global::System.Convert.ToString); } if (content.Contains("TargetResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).TargetResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).TargetResourceLocation, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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.Autoscale.Models.Api20221001.IAutoscaleSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleSetting(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.Autoscale.Models.Api20221001.IAutoscaleSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleSetting(content); } @@ -201,7 +201,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.TypeConverter.cs index 61248b2f9d7f..0fdf2d1328d8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSetting ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.cs similarity index 73% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.cs index bfb89f819947..7075b73373c6 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api2022100 /// A setting that contains all of the configuration for the automatic scaling of a resource. /// public partial class AutoscaleSetting : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal { /// Backing field for property. @@ -25,7 +25,7 @@ public partial class AutoscaleSetting : public bool? Enabled { get => this._enabled; set => this._enabled = value; } /// Internal Acessors for PredictiveAutoscalePolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal.PredictiveAutoscalePolicy { get => (this._predictiveAutoscalePolicy = this._predictiveAutoscalePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicy()); set { {_predictiveAutoscalePolicy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal.PredictiveAutoscalePolicy { get => (this._predictiveAutoscalePolicy = this._predictiveAutoscalePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicy()); set { {_predictiveAutoscalePolicy = value;} } } /// Backing field for property. private string _name; @@ -35,39 +35,39 @@ public partial class AutoscaleSetting : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] _notification; + private System.Collections.Generic.List _notification; /// the collection of notifications. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => this._notification; set => this._notification = value; } + public System.Collections.Generic.List Notification { get => this._notification; set => this._notification = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy _predictiveAutoscalePolicy; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy _predictiveAutoscalePolicy; /// the predictive autoscale policy mode. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get => (this._predictiveAutoscalePolicy = this._predictiveAutoscalePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicy()); set => this._predictiveAutoscalePolicy = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get => (this._predictiveAutoscalePolicy = this._predictiveAutoscalePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicy()); set => this._predictiveAutoscalePolicy = value; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleLookAheadTime = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleLookAheadTime = value ?? default(global::System.TimeSpan); } /// the predictive autoscale mode [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); } + public string PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)PredictiveAutoscalePolicy).ScaleMode = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] _profile; + private System.Collections.Generic.List _profile; /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => this._profile; set => this._profile = value; } + public System.Collections.Generic.List Profile { get => this._profile; set => this._profile = value; } /// Backing field for property. private string _targetResourceLocation; @@ -101,6 +101,9 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -109,6 +112,9 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the autoscale setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -117,10 +123,13 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + System.Collections.Generic.List Notification { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. @@ -128,6 +137,9 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format.", SerializedName = @"scaleLookAheadTime", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -136,10 +148,14 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. @@ -147,14 +163,20 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + System.Collections.Generic.List Profile { get; set; } /// the location of the resource that the autoscale setting should be added to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the location of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceLocation", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +187,9 @@ public partial interface IAutoscaleSetting : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the resource identifier of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceUri", PossibleTypes = new [] { typeof(string) })] @@ -182,21 +207,22 @@ internal partial interface IAutoscaleSettingInternal /// the name of the autoscale setting. string Name { get; set; } /// the collection of notifications. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + System.Collections.Generic.List Notification { get; set; } /// the predictive autoscale policy mode. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get; set; } /// the predictive autoscale mode - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + System.Collections.Generic.List Profile { get; set; } /// the location of the resource that the autoscale setting should be added to. string TargetResourceLocation { get; set; } /// diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.json.cs similarity index 86% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.json.cs index 7544be4890c0..70f82d77f629 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSetting.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSetting.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -67,24 +67,24 @@ internal AutoscaleSetting(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.R { return; } - {_predictiveAutoscalePolicy = If( json?.PropertyT("predictiveAutoscalePolicy"), out var __jsonPredictiveAutoscalePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicy.FromJson(__jsonPredictiveAutoscalePolicy) : PredictiveAutoscalePolicy;} - {_profile = If( json?.PropertyT("profiles"), out var __jsonProfiles) ? If( __jsonProfiles as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleProfile) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile.FromJson(__u) )) ))() : null : Profile;} - {_notification = If( json?.PropertyT("notifications"), out var __jsonNotifications) ? If( __jsonNotifications as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleNotification) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification.FromJson(__p) )) ))() : null : Notification;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_targetResourceUri = If( json?.PropertyT("targetResourceUri"), out var __jsonTargetResourceUri) ? (string)__jsonTargetResourceUri : (string)TargetResourceUri;} - {_targetResourceLocation = If( json?.PropertyT("targetResourceLocation"), out var __jsonTargetResourceLocation) ? (string)__jsonTargetResourceLocation : (string)TargetResourceLocation;} + {_predictiveAutoscalePolicy = If( json?.PropertyT("predictiveAutoscalePolicy"), out var __jsonPredictiveAutoscalePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicy.FromJson(__jsonPredictiveAutoscalePolicy) : _predictiveAutoscalePolicy;} + {_profile = If( json?.PropertyT("profiles"), out var __jsonProfiles) ? If( __jsonProfiles as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleProfile) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile.FromJson(__u) )) ))() : null : _profile;} + {_notification = If( json?.PropertyT("notifications"), out var __jsonNotifications) ? If( __jsonNotifications as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleNotification) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification.FromJson(__p) )) ))() : null : _notification;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_targetResourceUri = If( json?.PropertyT("targetResourceUri"), out var __jsonTargetResourceUri) ? (string)__jsonTargetResourceUri : (string)_targetResourceUri;} + {_targetResourceLocation = If( json?.PropertyT("targetResourceLocation"), out var __jsonTargetResourceLocation) ? (string)__jsonTargetResourceLocation : (string)_targetResourceLocation;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleSetting(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.PowerShell.cs new file mode 100644 index 000000000000..4a73240bea6e --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.PowerShell.cs @@ -0,0 +1,332 @@ +// 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.Autoscale.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + + /// The autoscale setting resource. + [System.ComponentModel.TypeConverter(typeof(AutoscaleSettingResourceTypeConverter))] + public partial class AutoscaleSettingResource + { + + /// + /// 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 AutoscaleSettingResource(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.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PredictiveAutoscalePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceUri, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("PredictiveAutoscalePolicyScaleMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); + } + if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AutoscaleSettingResource(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.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("PredictiveAutoscalePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Profile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); + } + if (content.Contains("Notification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertiesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PropertiesName, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceUri, global::System.Convert.ToString); + } + if (content.Contains("TargetResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).TargetResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("PredictiveAutoscalePolicyScaleMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); + } + if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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.Autoscale.Models.IAutoscaleSettingResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AutoscaleSettingResource(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.Autoscale.Models.IAutoscaleSettingResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AutoscaleSettingResource(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.Autoscale.Models.IAutoscaleSettingResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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 autoscale setting resource. + [System.ComponentModel.TypeConverter(typeof(AutoscaleSettingResourceTypeConverter))] + public partial interface IAutoscaleSettingResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.TypeConverter.cs index 91694b2b3cdf..5dbaf260a831 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.cs similarity index 56% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.cs index 4f2844a49556..a4e41d2e913d 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.cs @@ -3,118 +3,139 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The autoscale setting resource. public partial class AutoscaleSettingResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Resource(); /// /// the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Enabled = value ?? default(bool); } /// Azure resource Id [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Id; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Location = value ?? null; } /// Internal Acessors for PredictiveAutoscalePolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal.PredictiveAutoscalePolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal.PredictiveAutoscalePolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting()); set { {_property = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Type = value ?? null; } /// Azure resource name [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Name; } /// the collection of notifications. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Notification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Notification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Notification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Notification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Notification = value ?? null /* arrayOf */; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime = value ?? default(global::System.TimeSpan); } /// the predictive autoscale mode [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); } + public string PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode = value ?? null; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Profile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Profile = value ; } + public System.Collections.Generic.List Profile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Profile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Profile = value ; } /// the name of the autoscale setting. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Name = value ?? null; } + public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Name = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting _property; /// The autoscale setting of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// The system metadata related to the response. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this @@ -122,21 +143,21 @@ public partial class AutoscaleSettingResource : /// in length than 128 characters and a value no greater in length than 256 characters. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Tag = value ?? null /* model class */; } /// the location of the resource that the autoscale setting should be added to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string TargetResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceLocation = value ?? null; } + public string TargetResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceLocation = value ?? null; } /// /// the resource identifier of the resource that the autoscale setting should be added to. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string TargetResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceUri = value ?? null; } + public string TargetResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceUri = value ?? null; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public AutoscaleSettingResource() @@ -159,7 +180,7 @@ public AutoscaleSettingResource() /// The autoscale setting resource. public partial interface IAutoscaleSettingResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource { /// /// the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. @@ -167,6 +188,9 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -175,10 +199,13 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + System.Collections.Generic.List Notification { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. @@ -186,6 +213,9 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format.", SerializedName = @"scaleLookAheadTime", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -194,10 +224,14 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. @@ -205,14 +239,20 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + System.Collections.Generic.List Profile { get; set; } /// the name of the autoscale setting. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the autoscale setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -221,6 +261,9 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the location of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceLocation", PossibleTypes = new [] { typeof(string) })] @@ -231,6 +274,9 @@ public partial interface IAutoscaleSettingResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the resource identifier of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceUri", PossibleTypes = new [] { typeof(string) })] @@ -239,32 +285,33 @@ public partial interface IAutoscaleSettingResource : } /// The autoscale setting resource. internal partial interface IAutoscaleSettingResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal { /// /// the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. /// bool? Enabled { get; set; } /// the collection of notifications. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + System.Collections.Generic.List Notification { get; set; } /// the predictive autoscale policy mode. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get; set; } /// the predictive autoscale mode - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + System.Collections.Generic.List Profile { get; set; } /// the name of the autoscale setting. string PropertiesName { get; set; } /// The autoscale setting of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Property { get; set; } /// the location of the resource that the autoscale setting should be added to. string TargetResourceLocation { get; set; } /// diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.json.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.json.cs index fd2d52d13c30..7fcf0e6733e2 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResource.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResource.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AutoscaleSettingResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Aut { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleSettingResource(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.PowerShell.cs similarity index 74% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.PowerShell.cs index 555160ec1e42..0baeb7a8d44b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleSettingResourceCollection 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 AutoscaleSettingResourceCollection(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)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 AutoscaleSettingResourceCollection(global::System.Management.Automation // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal)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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleSettingResourceCollection(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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleSettingResourceCollection(content); } @@ -147,7 +147,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.TypeConverter.cs index fb1345aa948a..57d33df3d8f7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.cs similarity index 76% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.cs index 280a16563cd7..df34379e5172 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Represents a collection of autoscale setting resources. public partial class AutoscaleSettingResourceCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollectionInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AutoscaleSettingResourceCollection : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[] _value; + private System.Collections.Generic.List _value; /// the values for the autoscale setting resources. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[] 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 AutoscaleSettingResourceCollection() @@ -41,6 +41,9 @@ public partial interface IAutoscaleSettingResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"URL to get the next set of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAutoscaleSettingResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the values for the autoscale setting resources.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource) })] + System.Collections.Generic.List Value { get; set; } } /// Represents a collection of autoscale setting resources. @@ -62,7 +68,7 @@ internal partial interface IAutoscaleSettingResourceCollectionInternal /// URL to get the next set of results. string NextLink { get; set; } /// the values for the autoscale setting resources. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.json.cs similarity index 90% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.json.cs index 8e759f9eff0f..6e4a0119f965 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourceCollection.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourceCollection.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AutoscaleSettingResourceCollection(Microsoft.Azure.PowerShell.Cmdlets.M { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource.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.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleSettingResourceCollection(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.PowerShell.cs similarity index 50% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.PowerShell.cs index e71f16f13b16..c9611fbc2f7a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleSettingResourcePatch 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,53 +78,53 @@ internal AutoscaleSettingResourcePatch(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTagsTypeConverter.ConvertFrom); } if (content.Contains("PredictiveAutoscalePolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); } if (content.Contains("Profile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); } if (content.Contains("Notification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("TargetResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri, global::System.Convert.ToString); } if (content.Contains("TargetResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,75 +139,75 @@ internal AutoscaleSettingResourcePatch(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingTypeConverter.ConvertFrom); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTagsTypeConverter.ConvertFrom); } if (content.Contains("PredictiveAutoscalePolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy) content.GetValueForProperty("PredictiveAutoscalePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveAutoscalePolicyTypeConverter.ConvertFrom); } if (content.Contains("Profile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Profile = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Profile, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfileTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Profile = (System.Collections.Generic.List) content.GetValueForProperty("Profile",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Profile, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfileTypeConverter.ConvertFrom)); } if (content.Contains("Notification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Notification = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Notification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Notification = (System.Collections.Generic.List) content.GetValueForProperty("Notification",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Notification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotificationTypeConverter.ConvertFrom)); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("TargetResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri = (string) content.GetValueForProperty("TargetResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceUri, global::System.Convert.ToString); } if (content.Contains("TargetResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation = (string) content.GetValueForProperty("TargetResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).TargetResourceLocation, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode = (string) content.GetValueForProperty("PredictiveAutoscalePolicyScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleMode, global::System.Convert.ToString); } if (content.Contains("PredictiveAutoscalePolicyScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("PredictiveAutoscalePolicyScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal)this).PredictiveAutoscalePolicyScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleSettingResourcePatch(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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleSettingResourcePatch(content); } @@ -217,7 +217,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.TypeConverter.cs index d9650c23cd05..4e1b75323cc4 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.cs similarity index 65% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.cs index acd2e2568360..e6555c202717 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.cs @@ -3,77 +3,77 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The autoscale setting object for patch operations. public partial class AutoscaleSettingResourcePatch : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal { /// /// the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Enabled = value ?? default(bool); } /// Internal Acessors for PredictiveAutoscalePolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal.PredictiveAutoscalePolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal.PredictiveAutoscalePolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicy = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting()); set { {_property = value;} } } /// the name of the autoscale setting. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Name = value ?? null; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Name = value ?? null; } /// the collection of notifications. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Notification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Notification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Notification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Notification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Notification = value ?? null /* arrayOf */; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleLookAheadTime = value ?? default(global::System.TimeSpan); } /// the predictive autoscale mode [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); } + public string PredictiveAutoscalePolicyScaleMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).PredictiveAutoscalePolicyScaleMode = value ?? null; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Profile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).Profile = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Profile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Profile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).Profile = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting _property; /// The autoscale setting properties of the update operation. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting()); set => this._property = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTags()); set => this._tag = value; } /// the location of the resource that the autoscale setting should be added to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string TargetResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceLocation = value ?? null; } + public string TargetResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceLocation = value ?? null; } /// /// the resource identifier of the resource that the autoscale setting should be added to. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string TargetResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingInternal)Property).TargetResourceUri = value ?? null; } + public string TargetResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingInternal)Property).TargetResourceUri = value ?? null; } /// Creates an new instance. public AutoscaleSettingResourcePatch() @@ -91,6 +91,9 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -99,6 +102,9 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the autoscale setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -107,10 +113,13 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + System.Collections.Generic.List Notification { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. @@ -118,6 +127,9 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format.", SerializedName = @"scaleLookAheadTime", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -126,10 +138,14 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. @@ -137,22 +153,31 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + System.Collections.Generic.List Profile { get; set; } /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags Tag { get; set; } /// the location of the resource that the autoscale setting should be added to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the location of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceLocation", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +188,9 @@ public partial interface IAutoscaleSettingResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the resource identifier of the resource that the autoscale setting should be added to.", SerializedName = @"targetResourceUri", PossibleTypes = new [] { typeof(string) })] @@ -180,25 +208,26 @@ internal partial interface IAutoscaleSettingResourcePatchInternal /// the name of the autoscale setting. string Name { get; set; } /// the collection of notifications. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get; set; } + System.Collections.Generic.List Notification { get; set; } /// the predictive autoscale policy mode. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy PredictiveAutoscalePolicy { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in /// ISO 8601 format. /// global::System.TimeSpan? PredictiveAutoscalePolicyScaleLookAheadTime { get; set; } /// the predictive autoscale mode - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode? PredictiveAutoscalePolicyScaleMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string PredictiveAutoscalePolicyScaleMode { get; set; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum /// of 20 profiles can be specified. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get; set; } + System.Collections.Generic.List Profile { get; set; } /// The autoscale setting properties of the update operation. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSetting Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSetting Property { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags Tag { get; set; } /// the location of the resource that the autoscale setting should be added to. string TargetResourceLocation { get; set; } /// diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.json.cs similarity index 93% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.json.cs index 6f44f85fbc3b..ffc117c0356f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatch.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatch.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AutoscaleSettingResourcePatch(Microsoft.Azure.PowerShell.Cmdlets.Monito { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSetting.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSetting.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleSettingResourcePatch(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.PowerShell.cs similarity index 88% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.PowerShell.cs index e8f54f7c9a9b..1c5cfa90e94b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AutoscaleSettingResourcePatchTags 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 AutoscaleSettingResourcePatchTags(global::System.Collections.IDictionar } /// - /// 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 AutoscaleSettingResourcePatchTags(global::System.Management.Automation. } /// - /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AutoscaleSettingResourcePatchTags(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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AutoscaleSettingResourcePatchTags(content); } @@ -135,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.TypeConverter.cs index a7d7a78f0991..e5799b34c0b8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.cs similarity index 90% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.cs index 855a8f4de82e..602c3e1cd40b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Resource tags public partial class AutoscaleSettingResourcePatchTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.dictionary.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.dictionary.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.dictionary.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.dictionary.cs index 822a9bdba3eb..a701f3a8a886 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.dictionary.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatchTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatchTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.json.cs index 55c2dc095a4d..039750fdb7d9 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/AutoscaleSettingResourcePatchTags.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/AutoscaleSettingResourcePatchTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AutoscaleSettingResourcePatchTags(Microsoft.Azure.PowerShell.Cmdlets.Mo } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new AutoscaleSettingResourcePatchTags(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.PowerShell.cs similarity index 73% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.PowerShell.cs index d9fe7760f184..2d8682d852b8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class EmailNotification 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.Autoscale.Models.Api20221001.IEmailNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EmailNotification(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.Autoscale.Models.Api20221001.IEmailNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EmailNotification(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,21 +104,21 @@ internal EmailNotification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SendToSubscriptionAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendToSubscriptionCoAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).CustomEmail = (string[]) content.GetValueForProperty("CustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).CustomEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).CustomEmail = (System.Collections.Generic.List) content.GetValueForProperty("CustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).CustomEmail, __y => TypeConverterExtensions.SelectToList(__y, 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,15 +133,15 @@ internal EmailNotification(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("SendToSubscriptionAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("SendToSubscriptionCoAdministrator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator = (bool?) content.GetValueForProperty("SendToSubscriptionCoAdministrator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).SendToSubscriptionCoAdministrator, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("CustomEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).CustomEmail = (string[]) content.GetValueForProperty("CustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal)this).CustomEmail, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).CustomEmail = (System.Collections.Generic.List) content.GetValueForProperty("CustomEmail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal)this).CustomEmail, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -153,7 +151,7 @@ internal EmailNotification(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.Autoscale.Models.Api20221001.IEmailNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.TypeConverter.cs index fb5c40b7f646..dc45d245b3b1 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IEmailNotification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.cs similarity index 88% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.cs index 1c5da08ee799..2cf6dc5dc7aa 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.cs @@ -3,24 +3,24 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Email notification of an autoscale event. public partial class EmailNotification : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotificationInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotificationInternal { /// Backing field for property. - private string[] _customEmail; + private System.Collections.Generic.List _customEmail; /// /// the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public string[] CustomEmail { get => this._customEmail; set => this._customEmail = value; } + public System.Collections.Generic.List CustomEmail { get => this._customEmail; set => this._customEmail = value; } /// Backing field for property. private bool? _sendToSubscriptionAdministrator; @@ -52,14 +52,20 @@ public partial interface IEmailNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored.", SerializedName = @"customEmails", PossibleTypes = new [] { typeof(string) })] - string[] CustomEmail { get; set; } + System.Collections.Generic.List CustomEmail { get; set; } /// a value indicating whether to send email to subscription administrator. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether to send email to subscription administrator.", SerializedName = @"sendToSubscriptionAdministrator", PossibleTypes = new [] { typeof(bool) })] @@ -68,6 +74,9 @@ public partial interface IEmailNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether to send email to subscription co-administrators.", SerializedName = @"sendToSubscriptionCoAdministrators", PossibleTypes = new [] { typeof(bool) })] @@ -81,7 +90,7 @@ internal partial interface IEmailNotificationInternal /// /// the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. /// - string[] CustomEmail { get; set; } + System.Collections.Generic.List CustomEmail { get; set; } /// a value indicating whether to send email to subscription administrator. bool? SendToSubscriptionAdministrator { get; set; } /// a value indicating whether to send email to subscription co-administrators. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.json.cs similarity index 92% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.json.cs index 055f8ac00457..04130bb63a6f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/EmailNotification.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/EmailNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -65,20 +65,20 @@ internal EmailNotification(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale. { return; } - {_sendToSubscriptionAdministrator = If( json?.PropertyT("sendToSubscriptionAdministrator"), out var __jsonSendToSubscriptionAdministrator) ? (bool?)__jsonSendToSubscriptionAdministrator : SendToSubscriptionAdministrator;} - {_sendToSubscriptionCoAdministrator = If( json?.PropertyT("sendToSubscriptionCoAdministrators"), out var __jsonSendToSubscriptionCoAdministrators) ? (bool?)__jsonSendToSubscriptionCoAdministrators : SendToSubscriptionCoAdministrator;} - {_customEmail = If( json?.PropertyT("customEmails"), out var __jsonCustomEmails) ? If( __jsonCustomEmails as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : CustomEmail;} + {_sendToSubscriptionAdministrator = If( json?.PropertyT("sendToSubscriptionAdministrator"), out var __jsonSendToSubscriptionAdministrator) ? (bool?)__jsonSendToSubscriptionAdministrator : _sendToSubscriptionAdministrator;} + {_sendToSubscriptionCoAdministrator = If( json?.PropertyT("sendToSubscriptionCoAdministrators"), out var __jsonSendToSubscriptionCoAdministrators) ? (bool?)__jsonSendToSubscriptionCoAdministrators : _sendToSubscriptionCoAdministrator;} + {_customEmail = If( json?.PropertyT("customEmails"), out var __jsonCustomEmails) ? If( __jsonCustomEmails as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _customEmail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IEmailNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IEmailNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new EmailNotification(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.PowerShell.cs similarity index 53% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.PowerShell.cs index 4d87715c9d00..8ac8f8d592c8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MetricTrigger 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.Autoscale.Models.Api20221001.IMetricTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MetricTrigger(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.Autoscale.Models.Api20221001.IMetricTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricTrigger(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,57 +111,57 @@ internal MetricTrigger(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("MetricNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricNamespace = (string) content.GetValueForProperty("MetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricNamespace = (string) content.GetValueForProperty("MetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricNamespace, global::System.Convert.ToString); } if (content.Contains("MetricResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceUri = (string) content.GetValueForProperty("MetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceUri = (string) content.GetValueForProperty("MetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceUri, global::System.Convert.ToString); } if (content.Contains("MetricResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceLocation = (string) content.GetValueForProperty("MetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceLocation = (string) content.GetValueForProperty("MetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceLocation, global::System.Convert.ToString); } if (content.Contains("TimeGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeGrain = (global::System.TimeSpan) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeGrain = (global::System.TimeSpan) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("Statistic")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Statistic = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) content.GetValueForProperty("Statistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Statistic, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Statistic = (string) content.GetValueForProperty("Statistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Statistic, global::System.Convert.ToString); } if (content.Contains("TimeWindow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeWindow = (global::System.TimeSpan) content.GetValueForProperty("TimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeWindow = (global::System.TimeSpan) content.GetValueForProperty("TimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("TimeAggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeAggregation = (string) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeAggregation, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Threshold")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Threshold = (double) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Threshold = (double) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("DividePerInstance")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).DividePerInstance = (bool?) content.GetValueForProperty("DividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).DividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).DividePerInstance = (bool?) content.GetValueForProperty("DividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).DividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -176,51 +176,51 @@ internal MetricTrigger(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("MetricNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricNamespace = (string) content.GetValueForProperty("MetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricNamespace = (string) content.GetValueForProperty("MetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricNamespace, global::System.Convert.ToString); } if (content.Contains("MetricResourceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceUri = (string) content.GetValueForProperty("MetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceUri = (string) content.GetValueForProperty("MetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceUri, global::System.Convert.ToString); } if (content.Contains("MetricResourceLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceLocation = (string) content.GetValueForProperty("MetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).MetricResourceLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceLocation = (string) content.GetValueForProperty("MetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).MetricResourceLocation, global::System.Convert.ToString); } if (content.Contains("TimeGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeGrain = (global::System.TimeSpan) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeGrain = (global::System.TimeSpan) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("Statistic")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Statistic = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) content.GetValueForProperty("Statistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Statistic, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Statistic = (string) content.GetValueForProperty("Statistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Statistic, global::System.Convert.ToString); } if (content.Contains("TimeWindow")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeWindow = (global::System.TimeSpan) content.GetValueForProperty("TimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeWindow = (global::System.TimeSpan) content.GetValueForProperty("TimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("TimeAggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).TimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeAggregation = (string) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).TimeAggregation, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Threshold")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Threshold = (double) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Threshold = (double) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("DividePerInstance")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).DividePerInstance = (bool?) content.GetValueForProperty("DividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)this).DividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).DividePerInstance = (bool?) content.GetValueForProperty("DividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)this).DividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.TypeConverter.cs index a4bad2c16778..342a83cf988c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IMetricTrigger ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.cs similarity index 81% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.cs index d9551c389a6e..ca5fbd94bef8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.cs @@ -3,24 +3,24 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The trigger that results in a scaling action. public partial class MetricTrigger : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[] _dimension; + private System.Collections.Generic.List _dimension; /// /// List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + public System.Collections.Generic.List Dimension { get => this._dimension; set => this._dimension = value; } /// Backing field for property. private bool? _dividePerInstance; @@ -58,20 +58,20 @@ public partial class MetricTrigger : public string MetricResourceUri { get => this._metricResourceUri; set => this._metricResourceUri = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType _operator; + private string _operator; /// the operator that is used to compare the metric data and the threshold. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType _statistic; + private string _statistic; /// /// the metric statistic type. How the metrics from multiple instances are combined. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Statistic { get => this._statistic; set => this._statistic = value; } + public string Statistic { get => this._statistic; set => this._statistic = value; } /// Backing field for property. private double _threshold; @@ -81,13 +81,13 @@ public partial class MetricTrigger : public double Threshold { get => this._threshold; set => this._threshold = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType _timeAggregation; + private string _timeAggregation; /// /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType TimeAggregation { get => this._timeAggregation; set => this._timeAggregation = value; } + public string TimeAggregation { get => this._timeAggregation; set => this._timeAggregation = value; } /// Backing field for property. private global::System.TimeSpan _timeGrain; @@ -125,14 +125,20 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of dimension conditions. For example: [{""DimensionName"":""AppName"",""Operator"":""Equals"",""Values"":[""App1""]},{""DimensionName"":""Deployment"",""Operator"":""Equals"",""Values"":[""default""]}].", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[] Dimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension) })] + System.Collections.Generic.List Dimension { get; set; } /// a value indicating whether metric should divide per instance. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether metric should divide per instance.", SerializedName = @"dividePerInstance", PossibleTypes = new [] { typeof(bool) })] @@ -141,6 +147,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the metric that defines what the rule monitors.", SerializedName = @"metricName", PossibleTypes = new [] { typeof(string) })] @@ -149,6 +158,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the namespace of the metric that defines what the rule monitors.", SerializedName = @"metricNamespace", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +169,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the location of the resource the rule monitors.", SerializedName = @"metricResourceLocation", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +180,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the resource identifier of the resource the rule monitors.", SerializedName = @"metricResourceUri", PossibleTypes = new [] { typeof(string) })] @@ -173,24 +191,35 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the operator that is used to compare the metric data and the threshold.", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string Operator { get; set; } /// /// the metric statistic type. How the metrics from multiple instances are combined. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the metric statistic type. How the metrics from multiple instances are combined.", SerializedName = @"statistic", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Statistic { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] + string Statistic { get; set; } /// the threshold of the metric that triggers the scale action. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the threshold of the metric that triggers the scale action.", SerializedName = @"threshold", PossibleTypes = new [] { typeof(double) })] @@ -201,10 +230,14 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"time aggregation type. How the data that is collected should be combined over time. The default value is Average.", SerializedName = @"timeAggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType TimeAggregation { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] + string TimeAggregation { get; set; } /// /// 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. @@ -212,6 +245,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"timeGrain", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -223,6 +259,9 @@ public partial interface IMetricTrigger : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"timeWindow", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -236,7 +275,7 @@ internal partial interface IMetricTriggerInternal /// /// 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.Api20221001.IScaleRuleMetricDimension[] Dimension { get; set; } + System.Collections.Generic.List Dimension { get; set; } /// a value indicating whether metric should divide per instance. bool? DividePerInstance { get; set; } /// the name of the metric that defines what the rule monitors. @@ -248,17 +287,20 @@ internal partial interface IMetricTriggerInternal /// the resource identifier of the resource the rule monitors. string MetricResourceUri { get; set; } /// the operator that is used to compare the metric data and the threshold. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string Operator { get; set; } /// /// the metric statistic type. How the metrics from multiple instances are combined. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Statistic { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] + string Statistic { get; set; } /// the threshold of the metric that triggers the scale action. double Threshold { get; set; } /// /// 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.Support.TimeAggregationType TimeAggregation { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] + string TimeAggregation { get; set; } /// /// 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. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.json.cs similarity index 90% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.json.cs index acfc92643a37..361d96c963ae 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/MetricTrigger.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/MetricTrigger.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MetricTrigger partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new MetricTrigger(json) : null; } @@ -77,18 +77,18 @@ internal MetricTrigger(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runt { return; } - {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)MetricName;} - {_metricNamespace = If( json?.PropertyT("metricNamespace"), out var __jsonMetricNamespace) ? (string)__jsonMetricNamespace : (string)MetricNamespace;} - {_metricResourceUri = If( json?.PropertyT("metricResourceUri"), out var __jsonMetricResourceUri) ? (string)__jsonMetricResourceUri : (string)MetricResourceUri;} - {_metricResourceLocation = If( json?.PropertyT("metricResourceLocation"), out var __jsonMetricResourceLocation) ? (string)__jsonMetricResourceLocation : (string)MetricResourceLocation;} - {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeGrain ) : TimeGrain;} - {_statistic = If( json?.PropertyT("statistic"), out var __jsonStatistic) ? (string)__jsonStatistic : (string)Statistic;} - {_timeWindow = If( json?.PropertyT("timeWindow"), out var __jsonTimeWindow) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeWindow ) : TimeWindow;} - {_timeAggregation = If( json?.PropertyT("timeAggregation"), out var __jsonTimeAggregation) ? (string)__jsonTimeAggregation : (string)TimeAggregation;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (double)__jsonThreshold : Threshold;} - {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleRuleMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension.FromJson(__u) )) ))() : null : Dimension;} - {_dividePerInstance = If( json?.PropertyT("dividePerInstance"), out var __jsonDividePerInstance) ? (bool?)__jsonDividePerInstance : DividePerInstance;} + {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)_metricName;} + {_metricNamespace = If( json?.PropertyT("metricNamespace"), out var __jsonMetricNamespace) ? (string)__jsonMetricNamespace : (string)_metricNamespace;} + {_metricResourceUri = If( json?.PropertyT("metricResourceUri"), out var __jsonMetricResourceUri) ? (string)__jsonMetricResourceUri : (string)_metricResourceUri;} + {_metricResourceLocation = If( json?.PropertyT("metricResourceLocation"), out var __jsonMetricResourceLocation) ? (string)__jsonMetricResourceLocation : (string)_metricResourceLocation;} + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeGrain ) : _timeGrain;} + {_statistic = If( json?.PropertyT("statistic"), out var __jsonStatistic) ? (string)__jsonStatistic : (string)_statistic;} + {_timeWindow = If( json?.PropertyT("timeWindow"), out var __jsonTimeWindow) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeWindow ) : _timeWindow;} + {_timeAggregation = If( json?.PropertyT("timeAggregation"), out var __jsonTimeAggregation) ? (string)__jsonTimeAggregation : (string)_timeAggregation;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (double)__jsonThreshold : _threshold;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IScaleRuleMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension.FromJson(__u) )) ))() : null : _dimension;} + {_dividePerInstance = If( json?.PropertyT("dividePerInstance"), out var __jsonDividePerInstance) ? (bool?)__jsonDividePerInstance : _dividePerInstance;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.PowerShell.cs similarity index 75% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.PowerShell.cs index 2e8b7312bc48..acfed3af2b3a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class PredictiveAutoscalePolicy 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.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PredictiveAutoscalePolicy(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.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PredictiveAutoscalePolicy(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 PredictiveAutoscalePolicy(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("ScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("ScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleMode = (string) content.GetValueForProperty("ScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleMode, global::System.Convert.ToString); } if (content.Contains("ScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("ScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("ScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.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 PredictiveAutoscalePolicy(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ScaleMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleMode = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) content.GetValueForProperty("ScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleMode, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleMode = (string) content.GetValueForProperty("ScaleMode",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleMode, global::System.Convert.ToString); } if (content.Contains("ScaleLookAheadTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("ScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime = (global::System.TimeSpan?) content.GetValueForProperty("ScaleLookAheadTime",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal)this).ScaleLookAheadTime, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.TypeConverter.cs index 0970a0a814d5..9c5e5a1682f7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.cs similarity index 81% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.cs index 1daaadc3e9eb..0c73c4c154ea 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The parameters for enabling predictive autoscale. public partial class PredictiveAutoscalePolicy : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicyInternal { /// Backing field for property. @@ -24,11 +24,11 @@ public partial class PredictiveAutoscalePolicy : public global::System.TimeSpan? ScaleLookAheadTime { get => this._scaleLookAheadTime; set => this._scaleLookAheadTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode _scaleMode; + private string _scaleMode; /// the predictive autoscale mode [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode ScaleMode { get => this._scaleMode; set => this._scaleMode = value; } + public string ScaleMode { get => this._scaleMode; set => this._scaleMode = value; } /// Creates an new instance. public PredictiveAutoscalePolicy() @@ -47,6 +47,9 @@ public partial interface IPredictiveAutoscalePolicy : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format.", SerializedName = @"scaleLookAheadTime", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -55,10 +58,14 @@ public partial interface IPredictiveAutoscalePolicy : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode ScaleMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string ScaleMode { get; set; } } /// The parameters for enabling predictive autoscale. @@ -71,7 +78,8 @@ internal partial interface IPredictiveAutoscalePolicyInternal /// global::System.TimeSpan? ScaleLookAheadTime { get; set; } /// the predictive autoscale mode - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode ScaleMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + string ScaleMode { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.json.cs index 7d045a8eb819..f3d87eca5898 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveAutoscalePolicy.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveAutoscalePolicy.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PredictiveAutoscalePolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveAutoscalePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveAutoscalePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new PredictiveAutoscalePolicy(json) : null; } @@ -77,8 +77,8 @@ internal PredictiveAutoscalePolicy(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Au { return; } - {_scaleMode = If( json?.PropertyT("scaleMode"), out var __jsonScaleMode) ? (string)__jsonScaleMode : (string)ScaleMode;} - {_scaleLookAheadTime = If( json?.PropertyT("scaleLookAheadTime"), out var __jsonScaleLookAheadTime) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonScaleLookAheadTime ) : ScaleLookAheadTime;} + {_scaleMode = If( json?.PropertyT("scaleMode"), out var __jsonScaleMode) ? (string)__jsonScaleMode : (string)_scaleMode;} + {_scaleLookAheadTime = If( json?.PropertyT("scaleLookAheadTime"), out var __jsonScaleLookAheadTime) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonScaleLookAheadTime ) : _scaleLookAheadTime;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.PowerShell.cs similarity index 67% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.PowerShell.cs index 3412504790df..092e01483b9f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class PredictiveResponse 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.Autoscale.Models.Api20221001.IPredictiveResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PredictiveResponse(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.Autoscale.Models.Api20221001.IPredictiveResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PredictiveResponse(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,29 +111,29 @@ internal PredictiveResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Timespan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Timespan = (string) content.GetValueForProperty("Timespan",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Timespan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Timespan = (string) content.GetValueForProperty("Timespan",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Timespan, global::System.Convert.ToString); } if (content.Contains("Interval")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Interval = (global::System.TimeSpan?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Interval, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Interval = (global::System.TimeSpan?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Interval, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("TargetResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).TargetResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).TargetResourceId, global::System.Convert.ToString); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Data = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveValueTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveValueTypeConverter.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. @@ -150,23 +148,23 @@ internal PredictiveResponse(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Timespan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Timespan = (string) content.GetValueForProperty("Timespan",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Timespan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Timespan = (string) content.GetValueForProperty("Timespan",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Timespan, global::System.Convert.ToString); } if (content.Contains("Interval")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Interval = (global::System.TimeSpan?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Interval, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Interval = (global::System.TimeSpan?) content.GetValueForProperty("Interval",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Interval, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("TargetResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).TargetResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).TargetResourceId = (string) content.GetValueForProperty("TargetResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).TargetResourceId, global::System.Convert.ToString); } if (content.Contains("Data")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Data = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[]) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal)this).Data, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveValueTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Data = (System.Collections.Generic.List) content.GetValueForProperty("Data",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal)this).Data, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveValueTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.TypeConverter.cs index f2722e3d5727..4138b302c10b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IPredictiveResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.cs similarity index 87% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.cs index 161a952ab775..ed64524a2349 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The response to a metrics query. public partial class PredictiveResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[] _data; + private System.Collections.Generic.List _data; /// the value of the collection. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[] Data { get => this._data; set => this._data = value; } + public System.Collections.Generic.List Data { get => this._data; set => this._data = value; } /// Backing field for property. private global::System.TimeSpan? _interval; @@ -68,10 +68,13 @@ public partial interface IPredictiveResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the value of the collection.", SerializedName = @"data", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[] Data { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue) })] + System.Collections.Generic.List Data { get; set; } /// /// The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned /// back from what was originally requested. This is not present if a metadata request was made. @@ -79,6 +82,9 @@ public partial interface IPredictiveResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made.", SerializedName = @"interval", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -87,6 +93,9 @@ public partial interface IPredictiveResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The metrics being queried", SerializedName = @"metricName", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +104,9 @@ public partial interface IPredictiveResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"resource of the predictive metric.", SerializedName = @"targetResourceId", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +118,9 @@ public partial interface IPredictiveResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.", SerializedName = @"timespan", PossibleTypes = new [] { typeof(string) })] @@ -117,7 +132,7 @@ internal partial interface IPredictiveResponseInternal { /// the value of the collection. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue[] Data { get; set; } + System.Collections.Generic.List Data { get; set; } /// /// The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned /// back from what was originally requested. This is not present if a metadata request was made. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.json.cs similarity index 91% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.json.cs index 879de966d809..cb535d745cdb 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveResponse.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveResponse.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PredictiveResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new PredictiveResponse(json) : null; } @@ -77,11 +77,11 @@ internal PredictiveResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale { return; } - {_timespan = If( json?.PropertyT("timespan"), out var __jsonTimespan) ? (string)__jsonTimespan : (string)Timespan;} - {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonInterval ) : Interval;} - {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)MetricName;} - {_targetResourceId = If( json?.PropertyT("targetResourceId"), out var __jsonTargetResourceId) ? (string)__jsonTargetResourceId : (string)TargetResourceId;} - {_data = If( json?.PropertyT("data"), out var __jsonData) ? If( __jsonData as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IPredictiveValue) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.PredictiveValue.FromJson(__u) )) ))() : null : Data;} + {_timespan = If( json?.PropertyT("timespan"), out var __jsonTimespan) ? (string)__jsonTimespan : (string)_timespan;} + {_interval = If( json?.PropertyT("interval"), out var __jsonInterval) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonInterval ) : _interval;} + {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)_metricName;} + {_targetResourceId = If( json?.PropertyT("targetResourceId"), out var __jsonTargetResourceId) ? (string)__jsonTargetResourceId : (string)_targetResourceId;} + {_data = If( json?.PropertyT("data"), out var __jsonData) ? If( __jsonData as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IPredictiveValue) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.PredictiveValue.FromJson(__u) )) ))() : null : _data;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.PowerShell.cs similarity index 77% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.PowerShell.cs index 2199a97fee84..230d602ca3da 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PredictiveValue 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.Autoscale.Models.Api20221001.IPredictiveValue DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PredictiveValue(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.Autoscale.Models.Api20221001.IPredictiveValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PredictiveValue(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 PredictiveValue(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).TimeStamp, (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.Autoscale.Models.IPredictiveValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).Value = (double) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).Value = (double) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } 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 PredictiveValue(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TimeStamp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).TimeStamp, (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.Autoscale.Models.IPredictiveValueInternal)this).TimeStamp = (global::System.DateTime) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).Value = (double) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).Value = (double) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal)this).Value, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.TypeConverter.cs index efb2b3d78562..d9a45d111f4c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IPredictiveValue ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.cs index ce7e72dba488..0bb10b262bea 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Represents a predictive metric value in the given bucket. public partial class PredictiveValue : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValueInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValueInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IPredictiveValue : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the timestamp for the metric value in ISO 8601 format.", SerializedName = @"timeStamp", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -49,6 +52,9 @@ public partial interface IPredictiveValue : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Predictive value in this time bucket.", SerializedName = @"value", PossibleTypes = new [] { typeof(double) })] diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.json.cs index ff67a5f28713..48d7730feb5c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/PredictiveValue.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/PredictiveValue.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PredictiveValue partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveValue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new PredictiveValue(json) : null; } @@ -77,8 +77,8 @@ internal PredictiveValue(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Ru { return; } - {_timeStamp = If( json?.PropertyT("timeStamp"), out var __jsonTimeStamp) ? global::System.DateTime.TryParse((string)__jsonTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeStampValue) ? __jsonTimeStampValue : TimeStamp : TimeStamp;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double)__jsonValue : Value;} + {_timeStamp = If( json?.PropertyT("timeStamp"), out var __jsonTimeStamp) ? global::System.DateTime.TryParse((string)__jsonTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeStampValue) ? __jsonTimeStampValue : _timeStamp : _timeStamp;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (double)__jsonValue : _value;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.PowerShell.cs similarity index 65% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.PowerShell.cs index dfd45156c103..a365db27878d 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class Recurrence 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.Autoscale.Models.Api20221001.IRecurrence DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Recurrence(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.Autoscale.Models.Api20221001.IRecurrence DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Recurrence(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,33 +113,33 @@ internal Recurrence(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Schedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentScheduleTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentScheduleTypeConverter.ConvertFrom); } if (content.Contains("Frequency")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Frequency = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Frequency, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Frequency, global::System.Convert.ToString); } if (content.Contains("ScheduleTimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleTimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleTimeZone, global::System.Convert.ToString); } if (content.Contains("ScheduleDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleDay = (string[]) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleDay = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ScheduleHour")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleHour = (int[]) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleHour = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ScheduleMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleMinute = (int[]) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleMinute = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -154,27 +154,27 @@ internal Recurrence(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Schedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentScheduleTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentScheduleTypeConverter.ConvertFrom); } if (content.Contains("Frequency")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Frequency = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).Frequency, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Frequency = (string) content.GetValueForProperty("Frequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).Frequency, global::System.Convert.ToString); } if (content.Contains("ScheduleTimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleTimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleTimeZone = (string) content.GetValueForProperty("ScheduleTimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleTimeZone, global::System.Convert.ToString); } if (content.Contains("ScheduleDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleDay = (string[]) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleDay = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleDay, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ScheduleHour")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleHour = (int[]) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleHour = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleHour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleHour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ScheduleMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleMinute = (int[]) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleMinute = (System.Collections.Generic.List) content.GetValueForProperty("ScheduleMinute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal)this).ScheduleMinute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.TypeConverter.cs index beaa0b8e0327..dd786ef7a993 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IRecurrence ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.cs similarity index 85% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.cs index d57660bb5839..713e53db3097 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -11,12 +11,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api2022100 /// The repeating times at which this profile begins. This element is not used if the FixedDate element is used. /// public partial class Recurrence : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency _frequency; + private string _frequency; /// /// the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week @@ -24,34 +24,34 @@ public partial class Recurrence : /// frequency property specifies that the schedule is repeated weekly. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Frequency { get => this._frequency; set => this._frequency = value; } + public string Frequency { get => this._frequency; set => this._frequency = value; } /// Internal Acessors for Schedule - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrenceInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentSchedule()); set { {_schedule = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrenceInternal.Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentSchedule()); set { {_schedule = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule _schedule; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule _schedule; /// the scheduling constraints for when the profile begins. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentSchedule()); set => this._schedule = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule Schedule { get => (this._schedule = this._schedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentSchedule()); set => this._schedule = value; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string[] ScheduleDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Day = value ; } + public System.Collections.Generic.List ScheduleDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Day = value ; } /// /// 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). /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public int[] ScheduleHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Hour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Hour = value ; } + public System.Collections.Generic.List ScheduleHour { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Hour; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Hour = value ; } /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public int[] ScheduleMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Minute; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).Minute = value ; } + public System.Collections.Generic.List ScheduleMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Minute; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).Minute = value ; } /// /// the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian @@ -79,7 +79,7 @@ public partial class Recurrence : /// Standard Time /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string ScheduleTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)Schedule).TimeZone = value ; } + public string ScheduleTimeZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).TimeZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)Schedule).TimeZone = value ; } /// Creates an new instance. public Recurrence() @@ -99,20 +99,27 @@ public partial interface IRecurrence : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"frequency", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Frequency { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] + string Frequency { get; set; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.", SerializedName = @"days", PossibleTypes = new [] { typeof(string) })] - string[] ScheduleDay { get; set; } + System.Collections.Generic.List ScheduleDay { get; set; } /// /// 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). @@ -120,18 +127,24 @@ public partial interface IRecurrence : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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).", SerializedName = @"hours", PossibleTypes = new [] { typeof(int) })] - int[] ScheduleHour { get; set; } + System.Collections.Generic.List ScheduleHour { get; set; } /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of minutes at which the profile takes effect at.", SerializedName = @"minutes", PossibleTypes = new [] { typeof(int) })] - int[] ScheduleMinute { get; set; } + System.Collections.Generic.List ScheduleMinute { get; set; } /// /// 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, @@ -160,6 +173,9 @@ public partial interface IRecurrence : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"timeZone", PossibleTypes = new [] { typeof(string) })] @@ -175,20 +191,21 @@ internal partial interface IRecurrenceInternal /// 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.Support.RecurrenceFrequency Frequency { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] + string Frequency { get; set; } /// the scheduling constraints for when the profile begins. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule Schedule { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule Schedule { get; set; } /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// - string[] ScheduleDay { get; set; } + System.Collections.Generic.List ScheduleDay { get; set; } /// /// 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 { get; set; } + System.Collections.Generic.List ScheduleHour { get; set; } /// A collection of minutes at which the profile takes effect at. - int[] ScheduleMinute { get; set; } + System.Collections.Generic.List ScheduleMinute { get; set; } /// /// 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, diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.json.cs index 59abce0c6253..b434be75d123 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Recurrence.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Recurrence.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Recurrence partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrence FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrence FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new Recurrence(json) : null; } @@ -79,8 +79,8 @@ internal Recurrence(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime { return; } - {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.RecurrentSchedule.FromJson(__jsonSchedule) : Schedule;} - {_frequency = If( json?.PropertyT("frequency"), out var __jsonFrequency) ? (string)__jsonFrequency : (string)Frequency;} + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.RecurrentSchedule.FromJson(__jsonSchedule) : _schedule;} + {_frequency = If( json?.PropertyT("frequency"), out var __jsonFrequency) ? (string)__jsonFrequency : (string)_frequency;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.PowerShell.cs similarity index 71% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.PowerShell.cs index c36a2cb4bbbb..e7cad163cdd2 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class RecurrentSchedule 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.Autoscale.Models.Api20221001.IRecurrentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RecurrentSchedule(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.Autoscale.Models.Api20221001.IRecurrentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RecurrentSchedule(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 RecurrentSchedule(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).TimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).TimeZone, global::System.Convert.ToString); } if (content.Contains("Day")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Day = (string[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Day = (System.Collections.Generic.List) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Hour")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Hour = (int[]) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Hour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Hour = (System.Collections.Generic.List) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Hour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("Minute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Minute = (int[]) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Minute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Minute = (System.Collections.Generic.List) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Minute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } 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 RecurrentSchedule(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("TimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).TimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).TimeZone, global::System.Convert.ToString); } if (content.Contains("Day")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Day = (string[]) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Day = (System.Collections.Generic.List) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Day, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Hour")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Hour = (int[]) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Hour, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Hour = (System.Collections.Generic.List) content.GetValueForProperty("Hour",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Hour, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("Minute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Minute = (int[]) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal)this).Minute, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Minute = (System.Collections.Generic.List) content.GetValueForProperty("Minute",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal)this).Minute, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.TypeConverter.cs index 490e4d13ae55..a0ebcdf9aeca 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IRecurrentSchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.cs similarity index 93% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.cs index e5086718fd8e..4d9e0d967406 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.cs @@ -3,41 +3,41 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The scheduling constraints for when the profile begins. public partial class RecurrentSchedule : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentScheduleInternal { /// Backing field for property. - private string[] _day; + private System.Collections.Generic.List _day; /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public string[] Day { get => this._day; set => this._day = value; } + public System.Collections.Generic.List Day { get => this._day; set => this._day = value; } /// Backing field for property. - private int[] _hour; + private System.Collections.Generic.List _hour; /// /// 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). /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public int[] Hour { get => this._hour; set => this._hour = value; } + public System.Collections.Generic.List Hour { get => this._hour; set => this._hour = value; } /// Backing field for property. - private int[] _minute; + private System.Collections.Generic.List _minute; /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public int[] Minute { get => this._minute; set => this._minute = value; } + public System.Collections.Generic.List Minute { get => this._minute; set => this._minute = value; } /// Backing field for property. private string _timeZone; @@ -86,10 +86,13 @@ public partial interface IRecurrentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.", SerializedName = @"days", PossibleTypes = new [] { typeof(string) })] - string[] Day { get; set; } + System.Collections.Generic.List Day { get; set; } /// /// 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). @@ -97,18 +100,24 @@ public partial interface IRecurrentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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).", SerializedName = @"hours", PossibleTypes = new [] { typeof(int) })] - int[] Hour { get; set; } + System.Collections.Generic.List Hour { get; set; } /// A collection of minutes at which the profile takes effect at. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of minutes at which the profile takes effect at.", SerializedName = @"minutes", PossibleTypes = new [] { typeof(int) })] - int[] Minute { get; set; } + System.Collections.Generic.List Minute { get; set; } /// /// 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, @@ -137,6 +146,9 @@ public partial interface IRecurrentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"timeZone", PossibleTypes = new [] { typeof(string) })] @@ -150,14 +162,14 @@ internal partial interface IRecurrentScheduleInternal /// /// the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. /// - string[] Day { get; set; } + System.Collections.Generic.List Day { get; set; } /// /// 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[] Hour { get; set; } + System.Collections.Generic.List Hour { get; set; } /// A collection of minutes at which the profile takes effect at. - int[] Minute { get; set; } + System.Collections.Generic.List Minute { get; set; } /// /// 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, diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.json.cs similarity index 88% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.json.cs index e6b1aba9da4c..184601c790df 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/RecurrentSchedule.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/RecurrentSchedule.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RecurrentSchedule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IRecurrentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IRecurrentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new RecurrentSchedule(json) : null; } @@ -77,10 +77,10 @@ internal RecurrentSchedule(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale. { return; } - {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} - {_day = If( json?.PropertyT("days"), out var __jsonDays) ? If( __jsonDays as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Day;} - {_hour = If( json?.PropertyT("hours"), out var __jsonHours) ? If( __jsonHours as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(int) (__p is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNumber __o ? (int)__o : default(int))) ))() : null : Hour;} - {_minute = If( json?.PropertyT("minutes"), out var __jsonMinutes) ? If( __jsonMinutes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(int) (__k is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNumber __j ? (int)__j : default(int))) ))() : null : Minute;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)_timeZone;} + {_day = If( json?.PropertyT("days"), out var __jsonDays) ? If( __jsonDays as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _day;} + {_hour = If( json?.PropertyT("hours"), out var __jsonHours) ? If( __jsonHours as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(int) (__p is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNumber __o ? (int)__o : default(int))) ))() : null : _hour;} + {_minute = If( json?.PropertyT("minutes"), out var __jsonMinutes) ? If( __jsonMinutes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(int) (__k is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNumber __j ? (int)__j : default(int))) ))() : null : _minute;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 55% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.PowerShell.cs index 83cb7eee1622..2732ee160e18 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.PowerShell.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,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.Autoscale.Models.Api20221001.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,57 +111,57 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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. @@ -176,51 +176,51 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.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.Autoscale.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.TypeConverter.cs index 83ccc5342f2c..119d01183553 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.TypeConverter.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.cs similarity index 64% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.cs index 8a430534c3dd..bc24754352ab 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The autoscale setting resource. public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal { /// Backing field for property. @@ -28,16 +28,34 @@ public partial class Resource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -47,38 +65,38 @@ public partial class Resource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData _systemData; /// The system metadata related to the response. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags _tag; /// /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this @@ -86,7 +104,7 @@ public partial class Resource : /// in length than 128 characters and a value no greater in length than 256 characters. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTags()); set => this._tag = value; } /// Backing field for property. private string _type; @@ -109,14 +127,20 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource Id", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] string Id { get; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +149,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -132,51 +159,71 @@ public partial interface IResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater @@ -185,14 +232,20 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags Tag { get; set; } /// Azure resource type [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Azure resource type", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -210,25 +263,27 @@ internal partial interface IResourceInternal /// Azure resource name string Name { get; set; } /// The system metadata related to the response. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater /// in length than 128 characters and a value no greater in length than 256 characters. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags Tag { get; set; } /// Azure resource type string Type { get; set; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.json.cs similarity index 89% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/Resource.json.cs index adf3aa6c66d1..84eadb9d612a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/Resource.json.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -77,12 +77,12 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.J { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ResourceTags.FromJson(__jsonTags) : Tag;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } @@ -105,23 +105,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNod { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); AfterToJson(ref container); return container; diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.PowerShell.cs similarity index 90% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.PowerShell.cs index 63386c8a819e..0c1d82d40acb 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -67,27 +67,27 @@ public partial class ResourceTags 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.Autoscale.Models.Api20221001.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceTags(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.Autoscale.Models.Api20221001.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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. @@ -119,7 +119,7 @@ internal ResourceTags(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/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs index 58aaa1f88c3d..23abdce7ad06 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.cs index 718e68a2c77f..679f7b681e3e 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -13,8 +13,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api2022100 /// in length than 128 characters and a value no greater in length than 256 characters. /// public partial class ResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.dictionary.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.dictionary.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.dictionary.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.dictionary.cs index 9d58bbe7413e..6de0a46f93fc 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.dictionary.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.ResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.json.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.json.cs index b7a8a42b6c09..0dce986d347a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ResourceTags.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ResourceTags.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -58,13 +58,13 @@ public partial class ResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.PowerShell.cs similarity index 71% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.PowerShell.cs index 77dc0feb8f56..6c6b9492b097 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScaleAction 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.Autoscale.Models.Api20221001.IScaleAction DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScaleAction(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.Autoscale.Models.Api20221001.IScaleAction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScaleAction(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal ScaleAction(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Cooldown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Cooldown = (global::System.TimeSpan) content.GetValueForProperty("Cooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Cooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Cooldown = (global::System.TimeSpan) content.GetValueForProperty("Cooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Cooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal ScaleAction(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Cooldown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Cooldown = (global::System.TimeSpan) content.GetValueForProperty("Cooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)this).Cooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Cooldown = (global::System.TimeSpan) content.GetValueForProperty("Cooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)this).Cooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.TypeConverter.cs index eb33eaca854f..98b97e40db64 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleAction ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.cs similarity index 80% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.cs index f3d12d09fd47..5e56118655a8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The parameters for the scaling action. public partial class ScaleAction : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal { /// Backing field for property. @@ -24,20 +24,20 @@ public partial class ScaleAction : public global::System.TimeSpan Cooldown { get => this._cooldown; set => this._cooldown = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection _direction; + private string _direction; /// /// the scale direction. Whether the scaling action increases or decreases the number of instances. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection Direction { get => this._direction; set => this._direction = value; } + public string Direction { get => this._direction; set => this._direction = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType _type; + private string _type; /// the type of action that should occur when the scale rule fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Backing field for property. private string _value; @@ -66,6 +66,9 @@ public partial interface IScaleAction : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"cooldown", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -76,18 +79,26 @@ public partial interface IScaleAction : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the scale direction. Whether the scaling action increases or decreases the number of instances.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection Direction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] + string Direction { get; set; } /// the type of action that should occur when the scale rule fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the type of action that should occur when the scale rule fires.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] + string Type { get; set; } /// /// the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is /// 1. @@ -95,6 +106,9 @@ public partial interface IScaleAction : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -113,9 +127,11 @@ internal partial interface IScaleActionInternal /// /// the scale direction. Whether the scaling action increases or decreases the number of instances. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection Direction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] + string Direction { get; set; } /// the type of action that should occur when the scale rule fires. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] + string Type { get; set; } /// /// the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is /// 1. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.json.cs index f766cc1016f0..b98c2db980ec 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleAction.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleAction.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScaleAction partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new ScaleAction(json) : null; } @@ -77,10 +77,10 @@ internal ScaleAction(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtim { return; } - {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)Direction;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} - {_cooldown = If( json?.PropertyT("cooldown"), out var __jsonCooldown) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonCooldown ) : Cooldown;} + {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)_direction;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} + {_cooldown = If( json?.PropertyT("cooldown"), out var __jsonCooldown) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonCooldown ) : _cooldown;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.PowerShell.cs similarity index 77% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.PowerShell.cs index 6002e8f583d5..b80e1bafefc6 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScaleCapacity 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.Autoscale.Models.Api20221001.IScaleCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScaleCapacity(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.Autoscale.Models.Api20221001.IScaleCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScaleCapacity(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,21 +111,21 @@ internal ScaleCapacity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Minimum")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Minimum = (string) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Minimum, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Minimum = (string) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Minimum, global::System.Convert.ToString); } if (content.Contains("Maximum")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Maximum = (string) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Maximum, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Maximum = (string) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Maximum, global::System.Convert.ToString); } if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Default, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Default, 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. @@ -140,15 +140,15 @@ internal ScaleCapacity(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Minimum")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Minimum = (string) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Minimum, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Minimum = (string) content.GetValueForProperty("Minimum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Minimum, global::System.Convert.ToString); } if (content.Contains("Maximum")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Maximum = (string) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Maximum, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Maximum = (string) content.GetValueForProperty("Maximum",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Maximum, global::System.Convert.ToString); } if (content.Contains("Default")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal)this).Default, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Default = (string) content.GetValueForProperty("Default",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal)this).Default, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.TypeConverter.cs index fe7c5e73060a..c038d37a1267 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleCapacity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.cs index a9c7849d81d2..a783c857e0ff 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// The number of instances that can be used during this profile. public partial class ScaleCapacity : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacityInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacityInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IScaleCapacity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"default", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IScaleCapacity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"maximum", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IScaleCapacity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the minimum number of instances for the resource.", SerializedName = @"minimum", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.json.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.json.cs index f6c587b636a0..3fab88c41852 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleCapacity.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleCapacity.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScaleCapacity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new ScaleCapacity(json) : null; } @@ -77,9 +77,9 @@ internal ScaleCapacity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runt { return; } - {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (string)__jsonMinimum : (string)Minimum;} - {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (string)__jsonMaximum : (string)Maximum;} - {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)Default;} + {_minimum = If( json?.PropertyT("minimum"), out var __jsonMinimum) ? (string)__jsonMinimum : (string)_minimum;} + {_maximum = If( json?.PropertyT("maximum"), out var __jsonMaximum) ? (string)__jsonMaximum : (string)_maximum;} + {_default = If( json?.PropertyT("default"), out var __jsonDefault) ? (string)__jsonDefault : (string)_default;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.PowerShell.cs new file mode 100644 index 000000000000..e50c76205c3d --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.PowerShell.cs @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + + /// A rule that provide the triggers and parameters for the scaling action. + [System.ComponentModel.TypeConverter(typeof(ScaleRuleTypeConverter))] + public partial class ScaleRule + { + + /// + /// 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.Autoscale.Models.IScaleRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScaleRule(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.Autoscale.Models.IScaleRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScaleRule(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.Autoscale.Models.IScaleRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScaleRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger) content.GetValueForProperty("MetricTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTrigger, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("ScaleAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleAction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction) content.GetValueForProperty("ScaleAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleAction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleActionTypeConverter.ConvertFrom); + } + if (content.Contains("MetricTriggerMetricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricName = (string) content.GetValueForProperty("MetricTriggerMetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricName, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerMetricNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricNamespace = (string) content.GetValueForProperty("MetricTriggerMetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricNamespace, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerTimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeGrain = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerTimeWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeWindow = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerThreshold = (double) content.GetValueForProperty("MetricTriggerThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerThreshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MetricTriggerDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDimension = (System.Collections.Generic.List) content.GetValueForProperty("MetricTriggerDimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleActionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionValue = (string) content.GetValueForProperty("ScaleActionValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionValue, global::System.Convert.ToString); + } + if (content.Contains("ScaleActionCooldown")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionCooldown = (global::System.TimeSpan) content.GetValueForProperty("ScaleActionCooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionCooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerMetricResourceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceUri = (string) content.GetValueForProperty("MetricTriggerMetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceUri, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerMetricResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation = (string) content.GetValueForProperty("MetricTriggerMetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerStatistic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerStatistic = (string) content.GetValueForProperty("MetricTriggerStatistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerStatistic, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerTimeAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeAggregation = (string) content.GetValueForProperty("MetricTriggerTimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeAggregation, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerOperator = (string) content.GetValueForProperty("MetricTriggerOperator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerOperator, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerDividePerInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDividePerInstance = (bool?) content.GetValueForProperty("MetricTriggerDividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleActionDirection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionDirection = (string) content.GetValueForProperty("ScaleActionDirection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionDirection, global::System.Convert.ToString); + } + if (content.Contains("ScaleActionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionType = (string) content.GetValueForProperty("ScaleActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionType, 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 ScaleRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricTrigger")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTrigger = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger) content.GetValueForProperty("MetricTrigger",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTrigger, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTriggerTypeConverter.ConvertFrom); + } + if (content.Contains("ScaleAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleAction = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction) content.GetValueForProperty("ScaleAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleAction, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleActionTypeConverter.ConvertFrom); + } + if (content.Contains("MetricTriggerMetricName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricName = (string) content.GetValueForProperty("MetricTriggerMetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricName, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerMetricNamespace")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricNamespace = (string) content.GetValueForProperty("MetricTriggerMetricNamespace",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricNamespace, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerTimeGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeGrain = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerTimeWindow")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeWindow = (global::System.TimeSpan) content.GetValueForProperty("MetricTriggerTimeWindow",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeWindow, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerThreshold = (double) content.GetValueForProperty("MetricTriggerThreshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerThreshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + if (content.Contains("MetricTriggerDimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDimension = (System.Collections.Generic.List) content.GetValueForProperty("MetricTriggerDimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("ScaleActionValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionValue = (string) content.GetValueForProperty("ScaleActionValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionValue, global::System.Convert.ToString); + } + if (content.Contains("ScaleActionCooldown")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionCooldown = (global::System.TimeSpan) content.GetValueForProperty("ScaleActionCooldown",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionCooldown, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("MetricTriggerMetricResourceUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceUri = (string) content.GetValueForProperty("MetricTriggerMetricResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceUri, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerMetricResourceLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation = (string) content.GetValueForProperty("MetricTriggerMetricResourceLocation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerMetricResourceLocation, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerStatistic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerStatistic = (string) content.GetValueForProperty("MetricTriggerStatistic",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerStatistic, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerTimeAggregation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeAggregation = (string) content.GetValueForProperty("MetricTriggerTimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerTimeAggregation, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerOperator")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerOperator = (string) content.GetValueForProperty("MetricTriggerOperator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerOperator, global::System.Convert.ToString); + } + if (content.Contains("MetricTriggerDividePerInstance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDividePerInstance = (bool?) content.GetValueForProperty("MetricTriggerDividePerInstance",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).MetricTriggerDividePerInstance, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ScaleActionDirection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionDirection = (string) content.GetValueForProperty("ScaleActionDirection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionDirection, global::System.Convert.ToString); + } + if (content.Contains("ScaleActionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionType = (string) content.GetValueForProperty("ScaleActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal)this).ScaleActionType, 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.Autoscale.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(); + } + } + /// A rule that provide the triggers and parameters for the scaling action. + [System.ComponentModel.TypeConverter(typeof(ScaleRuleTypeConverter))] + public partial interface IScaleRule + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.TypeConverter.cs index 3edd47ec80de..93b6498ea70e 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.cs similarity index 68% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.cs index 9f28b90901a7..5b66a0b0ef4a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.cs @@ -3,119 +3,119 @@ // Code generated by 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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// A rule that provide the triggers and parameters for the scaling action. public partial class ScaleRule : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger _metricTrigger; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger _metricTrigger; /// the trigger that results in a scaling action. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger MetricTrigger { get => (this._metricTrigger = this._metricTrigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTrigger()); set => this._metricTrigger = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger MetricTrigger { get => (this._metricTrigger = this._metricTrigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTrigger()); set => this._metricTrigger = value; } /// /// List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[] MetricTriggerDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Dimension = value ?? null /* arrayOf */; } + public System.Collections.Generic.List MetricTriggerDimension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Dimension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Dimension = value ?? null /* arrayOf */; } /// a value indicating whether metric should divide per instance. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public bool? MetricTriggerDividePerInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).DividePerInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).DividePerInstance = value ?? default(bool); } + public bool? MetricTriggerDividePerInstance { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).DividePerInstance; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).DividePerInstance = value ?? default(bool); } /// the name of the metric that defines what the rule monitors. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string MetricTriggerMetricName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricName = value ; } + public string MetricTriggerMetricName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricName = value ; } /// the namespace of the metric that defines what the rule monitors. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string MetricTriggerMetricNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricNamespace = value ?? null; } + public string MetricTriggerMetricNamespace { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricNamespace; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricNamespace = value ?? null; } /// the location of the resource the rule monitors. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string MetricTriggerMetricResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricResourceLocation = value ?? null; } + public string MetricTriggerMetricResourceLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricResourceLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricResourceLocation = value ?? null; } /// the resource identifier of the resource the rule monitors. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string MetricTriggerMetricResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).MetricResourceUri = value ; } + public string MetricTriggerMetricResourceUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricResourceUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).MetricResourceUri = value ; } /// the operator that is used to compare the metric data and the threshold. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType MetricTriggerOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Operator = value ; } + public string MetricTriggerOperator { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Operator; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Operator = value ; } /// /// the metric statistic type. How the metrics from multiple instances are combined. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType MetricTriggerStatistic { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Statistic; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Statistic = value ; } + public string MetricTriggerStatistic { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Statistic; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Statistic = value ; } /// the threshold of the metric that triggers the scale action. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public double MetricTriggerThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Threshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).Threshold = value ; } + public double MetricTriggerThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Threshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).Threshold = value ; } /// /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType MetricTriggerTimeAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeAggregation = value ; } + public string MetricTriggerTimeAggregation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeAggregation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeAggregation = value ; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan MetricTriggerTimeGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeGrain = value ; } + public global::System.TimeSpan MetricTriggerTimeGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeGrain = value ; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan MetricTriggerTimeWindow { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeWindow; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTriggerInternal)MetricTrigger).TimeWindow = value ; } + public global::System.TimeSpan MetricTriggerTimeWindow { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeWindow; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTriggerInternal)MetricTrigger).TimeWindow = value ; } /// Internal Acessors for MetricTrigger - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal.MetricTrigger { get => (this._metricTrigger = this._metricTrigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTrigger()); set { {_metricTrigger = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal.MetricTrigger { get => (this._metricTrigger = this._metricTrigger ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTrigger()); set { {_metricTrigger = value;} } } /// Internal Acessors for ScaleAction - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleInternal.ScaleAction { get => (this._scaleAction = this._scaleAction ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleAction()); set { {_scaleAction = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleInternal.ScaleAction { get => (this._scaleAction = this._scaleAction ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleAction()); set { {_scaleAction = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction _scaleAction; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction _scaleAction; /// the parameters for the scaling action. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction ScaleAction { get => (this._scaleAction = this._scaleAction ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleAction()); set => this._scaleAction = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction ScaleAction { get => (this._scaleAction = this._scaleAction ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleAction()); set => this._scaleAction = value; } /// /// 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. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public global::System.TimeSpan ScaleActionCooldown { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Cooldown; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Cooldown = value ; } + public global::System.TimeSpan ScaleActionCooldown { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Cooldown; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Cooldown = value ; } /// /// the scale direction. Whether the scaling action increases or decreases the number of instances. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection ScaleActionDirection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Direction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Direction = value ; } + public string ScaleActionDirection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Direction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Direction = value ; } /// the type of action that should occur when the scale rule fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ScaleActionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Type = value ; } + public string ScaleActionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Type = value ; } /// /// the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is /// 1. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Inlined)] - public string ScaleActionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleActionInternal)ScaleAction).Value = value ?? null; } + public string ScaleActionValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleActionInternal)ScaleAction).Value = value ?? null; } /// Creates an new instance. public ScaleRule() @@ -133,14 +133,20 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of dimension conditions. For example: [{""DimensionName"":""AppName"",""Operator"":""Equals"",""Values"":[""App1""]},{""DimensionName"":""Deployment"",""Operator"":""Equals"",""Values"":[""default""]}].", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[] MetricTriggerDimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension) })] + System.Collections.Generic.List MetricTriggerDimension { get; set; } /// a value indicating whether metric should divide per instance. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether metric should divide per instance.", SerializedName = @"dividePerInstance", PossibleTypes = new [] { typeof(bool) })] @@ -149,6 +155,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the name of the metric that defines what the rule monitors.", SerializedName = @"metricName", PossibleTypes = new [] { typeof(string) })] @@ -157,6 +166,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the namespace of the metric that defines what the rule monitors.", SerializedName = @"metricNamespace", PossibleTypes = new [] { typeof(string) })] @@ -165,6 +177,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the location of the resource the rule monitors.", SerializedName = @"metricResourceLocation", PossibleTypes = new [] { typeof(string) })] @@ -173,6 +188,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the resource identifier of the resource the rule monitors.", SerializedName = @"metricResourceUri", PossibleTypes = new [] { typeof(string) })] @@ -181,24 +199,35 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the operator that is used to compare the metric data and the threshold.", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType MetricTriggerOperator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string MetricTriggerOperator { get; set; } /// /// the metric statistic type. How the metrics from multiple instances are combined. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the metric statistic type. How the metrics from multiple instances are combined.", SerializedName = @"statistic", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType MetricTriggerStatistic { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] + string MetricTriggerStatistic { get; set; } /// the threshold of the metric that triggers the scale action. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the threshold of the metric that triggers the scale action.", SerializedName = @"threshold", PossibleTypes = new [] { typeof(double) })] @@ -209,10 +238,14 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"time aggregation type. How the data that is collected should be combined over time. The default value is Average.", SerializedName = @"timeAggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType MetricTriggerTimeAggregation { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] + string MetricTriggerTimeAggregation { get; set; } /// /// 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. @@ -220,6 +253,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"timeGrain", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -231,6 +267,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"timeWindow", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -242,6 +281,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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.", SerializedName = @"cooldown", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -252,18 +294,26 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the scale direction. Whether the scaling action increases or decreases the number of instances.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection ScaleActionDirection { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] + string ScaleActionDirection { get; set; } /// the type of action that should occur when the scale rule fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the type of action that should occur when the scale rule fires.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ScaleActionType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] + string ScaleActionType { get; set; } /// /// the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is /// 1. @@ -271,6 +321,9 @@ public partial interface IScaleRule : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -282,11 +335,11 @@ internal partial interface IScaleRuleInternal { /// the trigger that results in a scaling action. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IMetricTrigger MetricTrigger { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IMetricTrigger MetricTrigger { get; set; } /// /// 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.Api20221001.IScaleRuleMetricDimension[] MetricTriggerDimension { get; set; } + System.Collections.Generic.List MetricTriggerDimension { get; set; } /// a value indicating whether metric should divide per instance. bool? MetricTriggerDividePerInstance { get; set; } /// the name of the metric that defines what the rule monitors. @@ -298,17 +351,20 @@ internal partial interface IScaleRuleInternal /// the resource identifier of the resource the rule monitors. string MetricTriggerMetricResourceUri { get; set; } /// the operator that is used to compare the metric data and the threshold. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType MetricTriggerOperator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string MetricTriggerOperator { get; set; } /// /// the metric statistic type. How the metrics from multiple instances are combined. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType MetricTriggerStatistic { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] + string MetricTriggerStatistic { get; set; } /// the threshold of the metric that triggers the scale action. double MetricTriggerThreshold { get; set; } /// /// 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.Support.TimeAggregationType MetricTriggerTimeAggregation { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] + string MetricTriggerTimeAggregation { get; set; } /// /// 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. @@ -320,7 +376,7 @@ internal partial interface IScaleRuleInternal /// global::System.TimeSpan MetricTriggerTimeWindow { get; set; } /// the parameters for the scaling action. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleAction ScaleAction { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleAction ScaleAction { get; set; } /// /// 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. @@ -329,9 +385,11 @@ internal partial interface IScaleRuleInternal /// /// the scale direction. Whether the scaling action increases or decreases the number of instances. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection ScaleActionDirection { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] + string ScaleActionDirection { get; set; } /// the type of action that should occur when the scale rule fires. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ScaleActionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] + string ScaleActionType { get; set; } /// /// the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is /// 1. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.json.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.json.cs index 863864011435..acaa83c5f784 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRule.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRule.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScaleRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new ScaleRule(json) : null; } @@ -77,8 +77,8 @@ internal ScaleRule(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime. { return; } - {_metricTrigger = If( json?.PropertyT("metricTrigger"), out var __jsonMetricTrigger) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.MetricTrigger.FromJson(__jsonMetricTrigger) : MetricTrigger;} - {_scaleAction = If( json?.PropertyT("scaleAction"), out var __jsonScaleAction) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleAction.FromJson(__jsonScaleAction) : ScaleAction;} + {_metricTrigger = If( json?.PropertyT("metricTrigger"), out var __jsonMetricTrigger) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.MetricTrigger.FromJson(__jsonMetricTrigger) : _metricTrigger;} + {_scaleAction = If( json?.PropertyT("scaleAction"), out var __jsonScaleAction) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleAction.FromJson(__jsonScaleAction) : _scaleAction;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.PowerShell.cs similarity index 73% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.PowerShell.cs index dc66ff606189..39657ae1f968 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ScaleRuleMetricDimension 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.Autoscale.Models.Api20221001.IScaleRuleMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScaleRuleMetricDimension(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.Autoscale.Models.Api20221001.IScaleRuleMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScaleRuleMetricDimension(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,21 +111,21 @@ internal ScaleRuleMetricDimension(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("DimensionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).DimensionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).DimensionName, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, 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. @@ -142,15 +140,15 @@ internal ScaleRuleMetricDimension(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("DimensionName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).DimensionName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).DimensionName = (string) content.GetValueForProperty("DimensionName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).DimensionName, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.TypeConverter.cs index d5831b71e4ca..68244700d833 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IScaleRuleMetricDimension ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.cs similarity index 79% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.cs index 8cf5ca4fac4e..30873797b4a7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Specifies an auto scale rule metric dimension. public partial class ScaleRuleMetricDimension : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimensionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimensionInternal { /// Backing field for property. @@ -21,21 +21,21 @@ public partial class ScaleRuleMetricDimension : public string DimensionName { get => this._dimensionName; set => this._dimensionName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType _operator; + private string _operator; /// /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; /// list of dimension values. For example: ["App1","App2"]. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public string[] 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 ScaleRuleMetricDimension() @@ -51,6 +51,9 @@ public partial interface IScaleRuleMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the dimension.", SerializedName = @"DimensionName", PossibleTypes = new [] { typeof(string) })] @@ -62,18 +65,25 @@ public partial interface IScaleRuleMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"Operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")] + string Operator { get; set; } /// list of dimension values. For example: ["App1","App2"]. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"list of dimension values. For example: [""App1"",""App2""].", SerializedName = @"Values", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// Specifies an auto scale rule metric dimension. @@ -86,9 +96,10 @@ internal partial interface IScaleRuleMetricDimensionInternal /// 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.Support.ScaleRuleMetricDimensionOperationType Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")] + string Operator { get; set; } /// list of dimension values. For example: ["App1","App2"]. - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.json.cs similarity index 93% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.json.cs index c666c37192ff..3d492dc7bace 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/ScaleRuleMetricDimension.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/ScaleRuleMetricDimension.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScaleRuleMetricDimension partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new ScaleRuleMetricDimension(json) : null; } @@ -77,9 +77,9 @@ internal ScaleRuleMetricDimension(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Aut { return; } - {_dimensionName = If( json?.PropertyT("DimensionName"), out var __jsonDimensionName) ? (string)__jsonDimensionName : (string)DimensionName;} - {_operator = If( json?.PropertyT("Operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_value = If( json?.PropertyT("Values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_dimensionName = If( json?.PropertyT("DimensionName"), out var __jsonDimensionName) ? (string)__jsonDimensionName : (string)_dimensionName;} + {_operator = If( json?.PropertyT("Operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_value = If( json?.PropertyT("Values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 65% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.PowerShell.cs index 9d50eafc81af..dda947a8bbc1 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 98% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 3663d4680387..89d926054197 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.cs index c786f4790863..cdb07852ef74 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/SystemData.json.cs index bd8b58b43432..af322f0edd3f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime { 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/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.PowerShell.cs similarity index 74% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.PowerShell.cs index 9819bcfdabf3..300105f29037 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TimeWindow 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.Autoscale.Models.Api20221001.ITimeWindow DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TimeWindow(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.Autoscale.Models.Api20221001.ITimeWindow DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TimeWindow(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,21 +111,21 @@ internal TimeWindow(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).TimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).TimeZone, global::System.Convert.ToString); } if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (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.Autoscale.Models.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (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.Autoscale.Models.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).End, (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. @@ -140,15 +140,15 @@ internal TimeWindow(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TimeZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).TimeZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).TimeZone = (string) content.GetValueForProperty("TimeZone",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).TimeZone, global::System.Convert.ToString); } if (content.Contains("Start")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).Start, (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.Autoscale.Models.ITimeWindowInternal)this).Start = (global::System.DateTime?) content.GetValueForProperty("Start",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).Start, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("End")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal)this).End, (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.Autoscale.Models.ITimeWindowInternal)this).End = (global::System.DateTime?) content.GetValueForProperty("End",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal)this).End, (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/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.TypeConverter.cs index 78b97d2b9508..4d9da16abb7e 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.ITimeWindow ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.cs similarity index 98% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.cs index bc991c5909c9..73c290c970a7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// A specific date-time for the profile. public partial class TimeWindow : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindowInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindowInternal { /// Backing field for property. @@ -72,6 +72,9 @@ public partial interface ITimeWindow : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the end time for the profile in ISO 8601 format.", SerializedName = @"end", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -80,6 +83,9 @@ public partial interface ITimeWindow : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the start time for the profile in ISO 8601 format.", SerializedName = @"start", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -112,6 +118,9 @@ public partial interface ITimeWindow : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"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", SerializedName = @"timeZone", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.json.cs similarity index 95% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.json.cs index d82ba156b9b4..333f9eb334d0 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/TimeWindow.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/TimeWindow.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TimeWindow partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ITimeWindow FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ITimeWindow FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new TimeWindow(json) : null; } @@ -77,9 +77,9 @@ internal TimeWindow(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime { return; } - {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)TimeZone;} - {_start = If( json?.PropertyT("start"), out var __jsonStart) ? global::System.DateTime.TryParse((string)__jsonStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartValue) ? __jsonStartValue : Start : Start;} - {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? global::System.DateTime.TryParse((string)__jsonEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndValue) ? __jsonEndValue : End : End;} + {_timeZone = If( json?.PropertyT("timeZone"), out var __jsonTimeZone) ? (string)__jsonTimeZone : (string)_timeZone;} + {_start = If( json?.PropertyT("start"), out var __jsonStart) ? global::System.DateTime.TryParse((string)__jsonStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartValue) ? __jsonStartValue : _start : _start;} + {_end = If( json?.PropertyT("end"), out var __jsonEnd) ? global::System.DateTime.TryParse((string)__jsonEnd, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndValue) ? __jsonEndValue : _end : _end;} AfterFromJson(json); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.PowerShell.cs similarity index 77% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.PowerShell.cs index 124c36d607a3..4ee54d1ab65b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WebhookNotification 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.Autoscale.Models.Api20221001.IWebhookNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebhookNotification(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.Autoscale.Models.Api20221001.IWebhookNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebhookNotification(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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. @@ -130,17 +128,17 @@ internal WebhookNotification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ServiceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).ServiceUri = (string) content.GetValueForProperty("ServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).ServiceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).ServiceUri = (string) content.GetValueForProperty("ServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).ServiceUri, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationPropertiesTypeConverter.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. @@ -155,11 +153,11 @@ internal WebhookNotification(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("ServiceUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).ServiceUri = (string) content.GetValueForProperty("ServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).ServiceUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).ServiceUri = (string) content.GetValueForProperty("ServiceUri",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).ServiceUri, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationPropertiesTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.TypeConverter.cs index c19471ef2b83..6f8e6be8f250 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IWebhookNotification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.cs similarity index 82% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.cs index 75437c7d1f28..5a9b7e653bc0 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// Webhook notification of an autoscale event. public partial class WebhookNotification : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties _property; /// a property bag of settings. This value can be empty. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationProperties()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationProperties()); set => this._property = value; } /// Backing field for property. private string _serviceUri; @@ -41,14 +41,20 @@ public partial interface IWebhookNotification : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a property bag of settings. This value can be empty.", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties Property { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties Property { get; set; } /// the service address to receive the notification. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the service address to receive the notification.", SerializedName = @"serviceUri", PossibleTypes = new [] { typeof(string) })] @@ -60,7 +66,7 @@ internal partial interface IWebhookNotificationInternal { /// a property bag of settings. This value can be empty. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties Property { get; set; } /// the service address to receive the notification. string ServiceUri { get; set; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.json.cs similarity index 94% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.json.cs index 36f49f29a4d7..ced8946240f6 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotification.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotification.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebhookNotification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new WebhookNotification(json) : null; } @@ -102,8 +102,8 @@ internal WebhookNotification(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscal { return; } - {_serviceUri = If( json?.PropertyT("serviceUri"), out var __jsonServiceUri) ? (string)__jsonServiceUri : (string)ServiceUri;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.WebhookNotificationProperties.FromJson(__jsonProperties) : Property;} + {_serviceUri = If( json?.PropertyT("serviceUri"), out var __jsonServiceUri) ? (string)__jsonServiceUri : (string)_serviceUri;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.PowerShell.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.PowerShell.cs similarity index 88% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.PowerShell.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.PowerShell.cs index 071948532cdc..78f6db89f483 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.PowerShell.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class WebhookNotificationProperties 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.Autoscale.Models.Api20221001.IWebhookNotificationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WebhookNotificationProperties(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.Autoscale.Models.Api20221001.IWebhookNotificationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WebhookNotificationProperties(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api202 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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. @@ -134,7 +134,7 @@ internal WebhookNotificationProperties(global::System.Collections.IDictionary co } /// - /// 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/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.TypeConverter.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.TypeConverter.cs index 24f7f1fa5d5f..28a35a4075ea 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.TypeConverter.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IWebhookNotificationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.cs similarity index 91% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.cs index 93dba6e83bd1..4bcf966c362c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; /// a property bag of settings. This value can be empty. public partial class WebhookNotificationProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationPropertiesInternal { /// Creates an new instance. diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.dictionary.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.dictionary.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.dictionary.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.dictionary.cs index 7b9723d1168c..4405fd8e4c34 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.dictionary.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.WebhookNotificationProperties source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.WebhookNotificationProperties source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.json.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.json.cs similarity index 96% rename from generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.json.cs rename to generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.json.cs index 3920ae1ee920..82ca6c67cea4 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Models/Api20221001/WebhookNotificationProperties.json.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/api/Models/WebhookNotificationProperties.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.Autoscale.Models.Api20221001 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WebhookNotificationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotificationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotificationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Json.JsonObject json ? new WebhookNotificationProperties(json) : null; } diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.Completer.cs deleted file mode 100644 index e048ae2a7a61..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.Completer.cs +++ /dev/null @@ -1,55 +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.Autoscale.Support -{ - - /// the operator that is used to compare the metric data and the threshold. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationTypeTypeConverter))] - public partial struct ComparisonOperationType : - 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) || "Equals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Equals'", "Equals", global::System.Management.Automation.CompletionResultType.ParameterValue, "Equals"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotEquals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotEquals'", "NotEquals", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotEquals"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThan'", "GreaterThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThanOrEqual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThanOrEqual'", "GreaterThanOrEqual", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThanOrEqual"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThan'", "LessThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThanOrEqual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThanOrEqual'", "LessThanOrEqual", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThanOrEqual"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.TypeConverter.cs deleted file mode 100644 index 87681398df27..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.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.Autoscale.Support -{ - - /// the operator that is used to compare the metric data and the threshold. - public partial class ComparisonOperationTypeTypeConverter : - 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) => ComparisonOperationType.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/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.cs deleted file mode 100644 index d8f300a1ac9b..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ComparisonOperationType.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.Autoscale.Support -{ - - /// the operator that is used to compare the metric data and the threshold. - public partial struct ComparisonOperationType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Equal = @"Equals"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType GreaterThan = @"GreaterThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType GreaterThanOrEqual = @"GreaterThanOrEqual"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType LessThan = @"LessThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType LessThanOrEqual = @"LessThanOrEqual"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType NotEquals = @"NotEquals"; - - /// 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 ComparisonOperationType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ComparisonOperationType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ComparisonOperationType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ComparisonOperationType - /// 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.Autoscale.Support.ComparisonOperationType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ComparisonOperationType (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 ComparisonOperationType && Equals((ComparisonOperationType)obj); - } - - /// Returns hashCode for enum ComparisonOperationType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ComparisonOperationType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ComparisonOperationType - /// the value to convert to an instance of . - - public static implicit operator ComparisonOperationType(string value) - { - return new ComparisonOperationType(value); - } - - /// Implicit operator to convert ComparisonOperationType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType e) - { - return e._value; - } - - /// Overriding != operator for enum ComparisonOperationType - /// 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.Autoscale.Support.ComparisonOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ComparisonOperationType - /// 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.Autoscale.Support.ComparisonOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index d163c8b0569b..000000000000 --- a/generated/Monitor/Autoscale.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.Autoscale.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 7dfb2a2a4c7c..000000000000 --- a/generated/Monitor/Autoscale.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.Autoscale.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/Autoscale.Autorest/generated/api/Support/CreatedByType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index a5b65994cbf4..000000000000 --- a/generated/Monitor/Autoscale.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.Autoscale.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.Completer.cs deleted file mode 100644 index 7d020facebe0..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.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.Autoscale.Support -{ - - /// - /// the metric statistic type. How the metrics from multiple instances are combined. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticTypeTypeConverter))] - public partial struct MetricStatisticType : - 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) || "Average".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Average'", "Average", global::System.Management.Automation.CompletionResultType.ParameterValue, "Average"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Min".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Min'", "Min", global::System.Management.Automation.CompletionResultType.ParameterValue, "Min"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Max".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Max'", "Max", global::System.Management.Automation.CompletionResultType.ParameterValue, "Max"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Sum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Sum'", "Sum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Sum"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.TypeConverter.cs deleted file mode 100644 index 2eb1382c4f8a..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.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.Autoscale.Support -{ - - /// - /// the metric statistic type. How the metrics from multiple instances are combined. - /// - public partial class MetricStatisticTypeTypeConverter : - 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) => MetricStatisticType.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/Autoscale.Autorest/generated/api/Support/MetricStatisticType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.cs deleted file mode 100644 index 37bfbf615ea3..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/MetricStatisticType.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.Autoscale.Support -{ - - /// - /// the metric statistic type. How the metrics from multiple instances are combined. - /// - public partial struct MetricStatisticType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Average = @"Average"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Count = @"Count"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Max = @"Max"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Min = @"Min"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType Sum = @"Sum"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MetricStatisticType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MetricStatisticType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MetricStatisticType - /// 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.Autoscale.Support.MetricStatisticType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MetricStatisticType (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 MetricStatisticType && Equals((MetricStatisticType)obj); - } - - /// Returns hashCode for enum MetricStatisticType - /// 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 MetricStatisticType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MetricStatisticType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MetricStatisticType - /// the value to convert to an instance of . - - public static implicit operator MetricStatisticType(string value) - { - return new MetricStatisticType(value); - } - - /// Implicit operator to convert MetricStatisticType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType e) - { - return e._value; - } - - /// Overriding != operator for enum MetricStatisticType - /// 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.Autoscale.Support.MetricStatisticType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MetricStatisticType - /// 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.Autoscale.Support.MetricStatisticType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.Completer.cs deleted file mode 100644 index 38811a7d1d29..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.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.Autoscale.Support -{ - - /// the predictive autoscale mode - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleModeTypeConverter))] - public partial struct PredictiveAutoscalePolicyScaleMode : - 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) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForecastOnly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForecastOnly'", "ForecastOnly", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForecastOnly"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.TypeConverter.cs deleted file mode 100644 index cbff270dadce..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.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.Autoscale.Support -{ - - /// the predictive autoscale mode - public partial class PredictiveAutoscalePolicyScaleModeTypeConverter : - 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) => PredictiveAutoscalePolicyScaleMode.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/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.cs deleted file mode 100644 index 17d0ce412eda..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/PredictiveAutoscalePolicyScaleMode.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.Autoscale.Support -{ - - /// the predictive autoscale mode - public partial struct PredictiveAutoscalePolicyScaleMode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode Enabled = @"Enabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode ForecastOnly = @"ForecastOnly"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PredictiveAutoscalePolicyScaleMode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PredictiveAutoscalePolicyScaleMode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PredictiveAutoscalePolicyScaleMode - /// 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.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PredictiveAutoscalePolicyScaleMode (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 PredictiveAutoscalePolicyScaleMode && Equals((PredictiveAutoscalePolicyScaleMode)obj); - } - - /// Returns hashCode for enum PredictiveAutoscalePolicyScaleMode - /// 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 PredictiveAutoscalePolicyScaleMode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PredictiveAutoscalePolicyScaleMode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PredictiveAutoscalePolicyScaleMode - /// the value to convert to an instance of . - - public static implicit operator PredictiveAutoscalePolicyScaleMode(string value) - { - return new PredictiveAutoscalePolicyScaleMode(value); - } - - /// Implicit operator to convert PredictiveAutoscalePolicyScaleMode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e) - { - return e._value; - } - - /// Overriding != operator for enum PredictiveAutoscalePolicyScaleMode - /// 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.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PredictiveAutoscalePolicyScaleMode - /// 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.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.Completer.cs deleted file mode 100644 index c4e217fb223e..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.Completer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support -{ - - /// - /// 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. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequencyTypeConverter))] - public partial struct RecurrenceFrequency : - 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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Second".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Second'", "Second", global::System.Management.Automation.CompletionResultType.ParameterValue, "Second"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Minute".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Minute'", "Minute", global::System.Management.Automation.CompletionResultType.ParameterValue, "Minute"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hour".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Hour'", "Hour", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hour"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Day".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Day'", "Day", global::System.Management.Automation.CompletionResultType.ParameterValue, "Day"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Week".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Week'", "Week", global::System.Management.Automation.CompletionResultType.ParameterValue, "Week"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Month".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Month'", "Month", global::System.Management.Automation.CompletionResultType.ParameterValue, "Month"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Year".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Year'", "Year", global::System.Management.Automation.CompletionResultType.ParameterValue, "Year"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.TypeConverter.cs deleted file mode 100644 index b3c484567a0d..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.TypeConverter.cs +++ /dev/null @@ -1,63 +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.Autoscale.Support -{ - - /// - /// 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. - /// - public partial class RecurrenceFrequencyTypeConverter : - 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) => RecurrenceFrequency.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/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.cs deleted file mode 100644 index 1e5ea95d6973..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/RecurrenceFrequency.cs +++ /dev/null @@ -1,114 +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.Autoscale.Support -{ - - /// - /// 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. - /// - public partial struct RecurrenceFrequency : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Day = @"Day"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Hour = @"Hour"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Minute = @"Minute"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Month = @"Month"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Second = @"Second"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Week = @"Week"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency Year = @"Year"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RecurrenceFrequency - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RecurrenceFrequency(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RecurrenceFrequency - /// 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.Autoscale.Support.RecurrenceFrequency e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RecurrenceFrequency (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 RecurrenceFrequency && Equals((RecurrenceFrequency)obj); - } - - /// Returns hashCode for enum RecurrenceFrequency - /// 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 RecurrenceFrequency(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RecurrenceFrequency - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RecurrenceFrequency - /// the value to convert to an instance of . - - public static implicit operator RecurrenceFrequency(string value) - { - return new RecurrenceFrequency(value); - } - - /// Implicit operator to convert RecurrenceFrequency to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency e) - { - return e._value; - } - - /// Overriding != operator for enum RecurrenceFrequency - /// 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.Autoscale.Support.RecurrenceFrequency e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RecurrenceFrequency - /// 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.Autoscale.Support.RecurrenceFrequency e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.Completer.cs deleted file mode 100644 index 38e966bb6747..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.Completer.cs +++ /dev/null @@ -1,45 +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.Autoscale.Support -{ - - /// - /// the scale direction. Whether the scaling action increases or decreases the number of instances. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirectionTypeConverter))] - public partial struct ScaleDirection : - 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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Increase".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Increase'", "Increase", global::System.Management.Automation.CompletionResultType.ParameterValue, "Increase"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Decrease".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Decrease'", "Decrease", global::System.Management.Automation.CompletionResultType.ParameterValue, "Decrease"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.TypeConverter.cs deleted file mode 100644 index d6d359ad333c..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.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.Autoscale.Support -{ - - /// - /// the scale direction. Whether the scaling action increases or decreases the number of instances. - /// - public partial class ScaleDirectionTypeConverter : - 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) => ScaleDirection.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/Autoscale.Autorest/generated/api/Support/ScaleDirection.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.cs deleted file mode 100644 index 06901f8e4912..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleDirection.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.Autoscale.Support -{ - - /// - /// the scale direction. Whether the scaling action increases or decreases the number of instances. - /// - public partial struct ScaleDirection : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection Decrease = @"Decrease"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection Increase = @"Increase"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection None = @"None"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ScaleDirection - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScaleDirection(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScaleDirection - /// 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.Autoscale.Support.ScaleDirection e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ScaleDirection (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 ScaleDirection && Equals((ScaleDirection)obj); - } - - /// Returns hashCode for enum ScaleDirection - /// 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 ScaleDirection(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScaleDirection - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScaleDirection - /// the value to convert to an instance of . - - public static implicit operator ScaleDirection(string value) - { - return new ScaleDirection(value); - } - - /// Implicit operator to convert ScaleDirection to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection e) - { - return e._value; - } - - /// Overriding != operator for enum ScaleDirection - /// 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.Autoscale.Support.ScaleDirection e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScaleDirection - /// 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.Autoscale.Support.ScaleDirection e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.Completer.cs deleted file mode 100644 index d8541f9e8df0..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.Completer.cs +++ /dev/null @@ -1,42 +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.Autoscale.Support -{ - - /// - /// 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 - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationTypeTypeConverter))] - public partial struct ScaleRuleMetricDimensionOperationType : - 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) || "Equals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Equals'", "Equals", global::System.Management.Automation.CompletionResultType.ParameterValue, "Equals"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotEquals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotEquals'", "NotEquals", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotEquals"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.TypeConverter.cs deleted file mode 100644 index 68a8954fdd53..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.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.Autoscale.Support -{ - - /// - /// 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 - /// - public partial class ScaleRuleMetricDimensionOperationTypeTypeConverter : - 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) => ScaleRuleMetricDimensionOperationType.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/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.cs deleted file mode 100644 index 3b101c87864b..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleRuleMetricDimensionOperationType.cs +++ /dev/null @@ -1,107 +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.Autoscale.Support -{ - - /// - /// 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 - /// - public partial struct ScaleRuleMetricDimensionOperationType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Equal = @"Equals"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType NotEquals = @"NotEquals"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ScaleRuleMetricDimensionOperationType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScaleRuleMetricDimensionOperationType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScaleRuleMetricDimensionOperationType - /// 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.Autoscale.Support.ScaleRuleMetricDimensionOperationType e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ScaleRuleMetricDimensionOperationType (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 ScaleRuleMetricDimensionOperationType && Equals((ScaleRuleMetricDimensionOperationType)obj); - } - - /// Returns hashCode for enum ScaleRuleMetricDimensionOperationType - /// 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 ScaleRuleMetricDimensionOperationType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScaleRuleMetricDimensionOperationType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScaleRuleMetricDimensionOperationType - /// the value to convert to an instance of . - - public static implicit operator ScaleRuleMetricDimensionOperationType(string value) - { - return new ScaleRuleMetricDimensionOperationType(value); - } - - /// Implicit operator to convert ScaleRuleMetricDimensionOperationType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType e) - { - return e._value; - } - - /// Overriding != operator for enum ScaleRuleMetricDimensionOperationType - /// 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.Autoscale.Support.ScaleRuleMetricDimensionOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScaleRuleMetricDimensionOperationType - /// 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.Autoscale.Support.ScaleRuleMetricDimensionOperationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.Completer.cs deleted file mode 100644 index aec7fe504a49..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.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.Autoscale.Support -{ - - /// the type of action that should occur when the scale rule fires. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleTypeTypeConverter))] - public partial struct ScaleType : - 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) || "ChangeCount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ChangeCount'", "ChangeCount", global::System.Management.Automation.CompletionResultType.ParameterValue, "ChangeCount"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PercentChangeCount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PercentChangeCount'", "PercentChangeCount", global::System.Management.Automation.CompletionResultType.ParameterValue, "PercentChangeCount"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ExactCount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ExactCount'", "ExactCount", global::System.Management.Automation.CompletionResultType.ParameterValue, "ExactCount"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServiceAllowedNextValue".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ServiceAllowedNextValue'", "ServiceAllowedNextValue", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServiceAllowedNextValue"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.TypeConverter.cs deleted file mode 100644 index 7c5ebe5f403e..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.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.Autoscale.Support -{ - - /// the type of action that should occur when the scale rule fires. - public partial class ScaleTypeTypeConverter : - 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) => ScaleType.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/Autoscale.Autorest/generated/api/Support/ScaleType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.cs deleted file mode 100644 index 3f4a6599cf9a..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/ScaleType.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.Autoscale.Support -{ - - /// the type of action that should occur when the scale rule fires. - public partial struct ScaleType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ChangeCount = @"ChangeCount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ExactCount = @"ExactCount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType PercentChangeCount = @"PercentChangeCount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType ServiceAllowedNextValue = @"ServiceAllowedNextValue"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ScaleType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScaleType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScaleType - /// 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.Autoscale.Support.ScaleType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ScaleType (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 ScaleType && Equals((ScaleType)obj); - } - - /// Returns hashCode for enum ScaleType - /// 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 ScaleType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScaleType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScaleType - /// the value to convert to an instance of . - - public static implicit operator ScaleType(string value) - { - return new ScaleType(value); - } - - /// Implicit operator to convert ScaleType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType e) - { - return e._value; - } - - /// Overriding != operator for enum ScaleType - /// 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.Autoscale.Support.ScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScaleType - /// 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.Autoscale.Support.ScaleType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.Completer.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.Completer.cs deleted file mode 100644 index 774d58c20bc0..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.Completer.cs +++ /dev/null @@ -1,57 +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.Autoscale.Support -{ - - /// - /// time aggregation type. How the data that is collected should be combined over time. The default value is Average. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationTypeTypeConverter))] - public partial struct TimeAggregationType : - 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) || "Average".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Average'", "Average", global::System.Management.Automation.CompletionResultType.ParameterValue, "Average"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Minimum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Minimum'", "Minimum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Minimum"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Maximum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Maximum'", "Maximum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Maximum"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Total".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Total'", "Total", global::System.Management.Automation.CompletionResultType.ParameterValue, "Total"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Last".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Last'", "Last", global::System.Management.Automation.CompletionResultType.ParameterValue, "Last"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.TypeConverter.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.TypeConverter.cs deleted file mode 100644 index 77d34cae9d09..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.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.Autoscale.Support -{ - - /// - /// time aggregation type. How the data that is collected should be combined over time. The default value is Average. - /// - public partial class TimeAggregationTypeTypeConverter : - 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) => TimeAggregationType.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/Autoscale.Autorest/generated/api/Support/TimeAggregationType.cs b/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.cs deleted file mode 100644 index 766b75610f23..000000000000 --- a/generated/Monitor/Autoscale.Autorest/generated/api/Support/TimeAggregationType.cs +++ /dev/null @@ -1,108 +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.Autoscale.Support -{ - - /// - /// time aggregation type. How the data that is collected should be combined over time. The default value is Average. - /// - public partial struct TimeAggregationType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Average = @"Average"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Count = @"Count"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Last = @"Last"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Maximum = @"Maximum"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Minimum = @"Minimum"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType Total = @"Total"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TimeAggregationType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TimeAggregationType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TimeAggregationType - /// 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.Autoscale.Support.TimeAggregationType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TimeAggregationType (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 TimeAggregationType && Equals((TimeAggregationType)obj); - } - - /// Returns hashCode for enum TimeAggregationType - /// 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 TimeAggregationType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for TimeAggregationType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to TimeAggregationType - /// the value to convert to an instance of . - - public static implicit operator TimeAggregationType(string value) - { - return new TimeAggregationType(value); - } - - /// Implicit operator to convert TimeAggregationType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType e) - { - return e._value; - } - - /// Overriding != operator for enum TimeAggregationType - /// 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.Autoscale.Support.TimeAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TimeAggregationType - /// 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.Autoscale.Support.TimeAggregationType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_Get.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_Get.cs index 61828fee0eb2..45038065e554 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_Get.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// get predictive autoscale metric future data @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscalePredictiveMetric_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Data"}, NewOutputProperties=new string[] {"Data"}, ChangeDescription="The type of the property 'Data' of type 'IPredictiveResponse' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"get predictive autoscale metric future data")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics", ApiVersion = "2022-10-01")] public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _aggregation; @@ -68,6 +82,9 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -81,6 +98,9 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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] @@ -152,7 +172,7 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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")] @@ -198,7 +218,8 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -223,24 +244,24 @@ public partial class GetAzAutoscalePredictiveMetric_Get : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IPredictiveResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -263,6 +284,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -284,7 +310,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscalePredictiveMetric_Get() { @@ -335,8 +361,33 @@ public GetAzAutoscalePredictiveMetric_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -389,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -410,7 +461,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,AutoscaleSettingName=AutoscaleSettingName,Timespan=Timespan,Interval=Interval,MetricNamespace=MetricNamespace,MetricName=MetricName,Aggregation=Aggregation}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AutoscaleSettingName=AutoscaleSettingName,Timespan=Timespan,Interval=Interval,MetricNamespace=MetricNamespace,MetricName=MetricName,Aggregation=Aggregation}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -448,12 +499,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -470,15 +521,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.Autoscale.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, AutoscaleSettingName=AutoscaleSettingName, Timespan=Timespan, Interval=Interval, MetricNamespace=MetricNamespace, MetricName=MetricName, Aggregation=Aggregation }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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, AutoscaleSettingName=AutoscaleSettingName, Timespan=Timespan, Interval=Interval, MetricNamespace=MetricNamespace, MetricName=MetricName, Aggregation=Aggregation }) + 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 } }); @@ -488,12 +539,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.Autoscale.Models.Api20221001.IPredictiveResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse /// 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 ) { @@ -505,8 +556,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse + 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/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_GetViaIdentity.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_GetViaIdentity.cs index 3f01852451de..f9fc5380878a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_GetViaIdentity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscalePredictiveMetric_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// get predictive autoscale metric future data @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscalePredictiveMetric_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Data"}, NewOutputProperties=new string[] {"Data"}, ChangeDescription="The type of the property 'Data' of type 'IPredictiveResponse' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"get predictive autoscale metric future data")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics", ApiVersion = "2022-10-01")] public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +37,18 @@ public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _aggregation; @@ -54,6 +68,9 @@ public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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] @@ -146,7 +166,7 @@ public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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")] @@ -185,24 +205,24 @@ public partial class GetAzAutoscalePredictiveMetric_GetViaIdentity : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IPredictiveResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse /// 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) @@ -225,6 +245,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -246,7 +271,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscalePredictiveMetric_GetViaIdentity() { @@ -297,8 +322,33 @@ public GetAzAutoscalePredictiveMetric_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -389,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Timespan=Timespan,Interval=Interval,MetricNamespace=MetricNamespace,MetricName=MetricName,Aggregation=Aggregation}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Timespan=Timespan,Interval=Interval,MetricNamespace=MetricNamespace,MetricName=MetricName,Aggregation=Aggregation}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -427,12 +477,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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -449,15 +499,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.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Timespan=Timespan, Interval=Interval, MetricNamespace=MetricNamespace, MetricName=MetricName, Aggregation=Aggregation }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 { Timespan=Timespan, Interval=Interval, MetricNamespace=MetricNamespace, MetricName=MetricName, Aggregation=Aggregation }) + 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 } }); @@ -467,12 +517,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.Autoscale.Models.Api20221001.IPredictiveResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse /// 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 ) { @@ -484,8 +534,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IPredictiveResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IPredictiveResponse + 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/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_Get.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_Get.cs index 853c4de730ee..077f967fcc17 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_Get.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Gets an autoscale setting @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscaleSetting_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Gets an autoscale setting")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class GetAzAutoscaleSetting_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzAutoscaleSetting_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +114,7 @@ public partial class GetAzAutoscaleSetting_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +160,8 @@ public partial class GetAzAutoscaleSetting_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscaleSetting_Get() { @@ -261,8 +287,33 @@ public GetAzAutoscaleSetting_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,13 +381,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AutoscaleSettingsGet(ResourceGroupName, Name, SubscriptionId, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId}) + 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 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 { ResourceGroupName=ResourceGroupName, Name=Name, 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 } }); @@ -414,12 +465,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_GetViaIdentity.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_GetViaIdentity.cs index 15af9690aae9..95a0b438248b 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_GetViaIdentity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Gets an autoscale setting @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscaleSetting_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Gets an autoscale setting")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class GetAzAutoscaleSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzAutoscaleSetting_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +107,7 @@ public partial class GetAzAutoscaleSetting_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +130,24 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscaleSetting_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzAutoscaleSetting_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,6 +346,10 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } if (null == InputObject.ResourceGroupName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -304,17 +358,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AutoscaleSettingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.AutoscaleSettingsGet(InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List.cs index e5cb819d3314..23db975d0383 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Lists the autoscale settings for a resource group @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscaleSetting_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Lists the autoscale settings for a resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings", ApiVersion = "2022-10-01")] public partial class GetAzAutoscaleSetting_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzAutoscaleSetting_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +105,7 @@ public partial class GetAzAutoscaleSetting_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +151,8 @@ public partial class GetAzAutoscaleSetting_List : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscaleSetting_List() { @@ -252,8 +278,33 @@ public GetAzAutoscaleSetting_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,13 +372,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AutoscaleSettingsListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + 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 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 { ResourceGroupName=ResourceGroupName, 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 } }); @@ -405,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection /// 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 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection + 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/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List1.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List1.cs index 9a3ed38045ed..59a929d063f8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List1.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/GetAzAutoscaleSetting_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Lists the autoscale settings for a subscription @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzAutoscaleSetting_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Lists the autoscale settings for a subscription")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings", ApiVersion = "2022-10-01")] public partial class GetAzAutoscaleSetting_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzAutoscaleSetting_List1 : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +105,7 @@ public partial class GetAzAutoscaleSetting_List1 : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +137,8 @@ public partial class GetAzAutoscaleSetting_List1 : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection /// 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 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzAutoscaleSetting_List1() { @@ -238,8 +264,33 @@ public GetAzAutoscaleSetting_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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection /// 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 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourceCollection + 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/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateExpanded.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateExpanded.cs index f8a03e0fb1ad..1bcc191698cf 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateExpanded.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; - /// Creates or updates an autoscale setting. + /// create an autoscale setting. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAutoscaleSetting_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Creates or updates an autoscale setting.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"create an autoscale setting.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +37,29 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : 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; + /// The autoscale setting resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResource(); + + /// + /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -69,6 +86,9 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _parametersBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -127,13 +147,13 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => _parametersBody.Notification ?? null /* arrayOf */; set => _parametersBody.Notification = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[] Notification { get => _parametersBody.Notification?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Notification = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in @@ -157,9 +177,9 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode))] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode PredictiveAutoscalePolicyScaleMode { get => _parametersBody.PredictiveAutoscalePolicyScaleMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); set => _parametersBody.PredictiveAutoscalePolicyScaleMode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + public string PredictiveAutoscalePolicyScaleMode { get => _parametersBody.PredictiveAutoscalePolicyScaleMode ?? null; set => _parametersBody.PredictiveAutoscalePolicyScaleMode = value; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum @@ -173,9 +193,8 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Profile", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => _parametersBody.Profile ?? null /* arrayOf */; set => _parametersBody.Profile = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[] Profile { get => _parametersBody.Profile?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Profile = (value != null ? new System.Collections.Generic.List(value) : null); } /// the name of the autoscale setting. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the name of the autoscale setting.")] @@ -232,7 +251,8 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -249,8 +269,8 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// the location of the resource that the autoscale setting should be added to. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the location of the resource that the autoscale setting should be added to.")] @@ -281,36 +301,36 @@ public partial class NewAzAutoscaleSetting_CreateExpanded : 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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) @@ -333,6 +353,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -397,8 +422,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -408,7 +458,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzAutoscaleSetting_CreateExpanded() { @@ -462,7 +512,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -475,12 +525,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AutoscaleSettingsCreateOrUpdate(ResourceGroupName, Name, SubscriptionId, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId,body=_parametersBody}) + 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 } }); @@ -516,12 +566,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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 ) { @@ -533,8 +583,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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; + } + } } } @@ -542,12 +610,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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -564,15 +632,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.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId, body=_parametersBody }) + 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 } }); @@ -582,12 +650,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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 ) { @@ -599,8 +667,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonFilePath.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..1de0b4e56b10 --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonFilePath.cs @@ -0,0 +1,578 @@ +// 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.Autoscale.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; + using System; + + /// create an autoscale setting. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAutoscaleSetting_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"create an autoscale setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.NotSuggestDefaultParameterSet] + public partial class NewAzAutoscaleSetting_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The autoscale setting name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The autoscale setting name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The autoscale setting name.", + SerializedName = @"autoscaleSettingName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AutoscaleSettingName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 NewAzAutoscaleSetting_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AutoscaleSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AutoscaleSettingsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleSettingResource + 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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonString.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonString.cs new file mode 100644 index 000000000000..b39ad021febc --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaJsonString.cs @@ -0,0 +1,576 @@ +// 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.Autoscale.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; + using System; + + /// create an autoscale setting. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAutoscaleSetting_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"create an autoscale setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.NotSuggestDefaultParameterSet] + public partial class NewAzAutoscaleSetting_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The autoscale setting name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The autoscale setting name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The autoscale setting name.", + SerializedName = @"autoscaleSettingName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AutoscaleSettingName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 NewAzAutoscaleSetting_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AutoscaleSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AutoscaleSettingsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleSettingResource + 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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_Delete.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_Delete.cs index 554655003382..4ebf3e18818e 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_Delete.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Deletes and autoscale setting @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class RemoveAzAutoscaleSetting_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzAutoscaleSetting_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(); + + /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzAutoscaleSetting_Delete : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class RemoveAzAutoscaleSetting_Delete : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -146,7 +167,8 @@ public partial class RemoveAzAutoscaleSetting_Delete : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -155,12 +177,12 @@ public partial class RemoveAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 @@ -203,6 +225,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,8 +294,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -324,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +389,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AutoscaleSettingsDelete(ResourceGroupName, Name, SubscriptionId, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsDelete(SubscriptionId, ResourceGroupName, Name, onOk, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,Name=Name,SubscriptionId=SubscriptionId}) + 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 } }); @@ -355,7 +407,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzAutoscaleSetting_Delete() { @@ -388,12 +440,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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -410,15 +462,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.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, Name=Name, SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 { ResourceGroupName=ResourceGroupName, Name=Name, 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 } }); @@ -443,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); } @@ -467,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/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_DeleteViaIdentity.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_DeleteViaIdentity.cs index c5efaf89df91..c829f3365137 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_DeleteViaIdentity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/RemoveAzAutoscaleSetting_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// Deletes and autoscale setting @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class RemoveAzAutoscaleSetting_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzAutoscaleSetting_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(); + + /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzAutoscaleSetting_DeleteViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzAutoscaleSetting_DeleteViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 @@ -164,6 +185,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,6 +356,10 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } if (null == InputObject.ResourceGroupName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -313,17 +368,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AutoscaleSettingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.AutoscaleSettingsDelete(InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, onOk, onNoContent, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzAutoscaleSetting_DeleteViaIdentity() { @@ -369,12 +420,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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -391,7 +442,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.Autoscale.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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 } @@ -424,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); } @@ -448,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/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateExpanded.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateExpanded.cs index 5bb2f4baa0c2..d5de6ecd5964 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateExpanded.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// - /// Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAutoscaleSetting_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,13 +36,25 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma private string __processRecordId; /// The autoscale setting object for patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch _autoscaleSettingResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatch(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch _autoscaleSettingResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatch(); /// /// 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; + /// Backing field for property. private string _autoscaleSettingName; @@ -60,6 +74,9 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -86,6 +103,9 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _autoscaleSettingResourceBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _autoscaleSettingResourceBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -129,13 +149,13 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => _autoscaleSettingResourceBody.Notification ?? null /* arrayOf */; set => _autoscaleSettingResourceBody.Notification = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[] Notification { get => _autoscaleSettingResourceBody.Notification?.ToArray() ?? null /* fixedArrayOf */; set => _autoscaleSettingResourceBody.Notification = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in @@ -159,9 +179,9 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode))] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode PredictiveAutoscalePolicyScaleMode { get => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); set => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + public string PredictiveAutoscalePolicyScaleMode { get => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode ?? null; set => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode = value; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum @@ -175,9 +195,8 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Profile", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => _autoscaleSettingResourceBody.Profile ?? null /* arrayOf */; set => _autoscaleSettingResourceBody.Profile = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[] Profile { get => _autoscaleSettingResourceBody.Profile?.ToArray() ?? null /* fixedArrayOf */; set => _autoscaleSettingResourceBody.Profile = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -223,7 +242,8 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -236,8 +256,8 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags Tag { get => _autoscaleSettingResourceBody.Tag ?? null /* object */; set => _autoscaleSettingResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags Tag { get => _autoscaleSettingResourceBody.Tag ?? null /* object */; set => _autoscaleSettingResourceBody.Tag = value; } /// the location of the resource that the autoscale setting should be added to. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the location of the resource that the autoscale setting should be added to.")] @@ -268,24 +288,24 @@ public partial class UpdateAzAutoscaleSetting_UpdateExpanded : global::System.Ma /// 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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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) @@ -308,6 +328,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -372,8 +397,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -429,7 +479,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -442,12 +492,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AutoscaleSettingsUpdate(SubscriptionId, ResourceGroupName, AutoscaleSettingName, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsUpdate(SubscriptionId, ResourceGroupName, AutoscaleSettingName, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,AutoscaleSettingName=AutoscaleSettingName,body=_autoscaleSettingResourceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AutoscaleSettingName=AutoscaleSettingName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -467,7 +517,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzAutoscaleSetting_UpdateExpanded() { @@ -493,12 +543,12 @@ public UpdateAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -515,15 +565,15 @@ public UpdateAzAutoscaleSetting_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.Autoscale.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, AutoscaleSettingName=AutoscaleSettingName, body=_autoscaleSettingResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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, AutoscaleSettingName=AutoscaleSettingName, body=_autoscaleSettingResourceBody }) + 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 } }); @@ -533,12 +583,12 @@ public UpdateAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 ) { @@ -550,8 +600,26 @@ public UpdateAzAutoscaleSetting_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded.cs index 9831bd5bb119..a963872bd38a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; /// - /// Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAutoscaleSetting_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,18 +36,33 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global private string __processRecordId; /// The autoscale setting object for patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatch _autoscaleSettingResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleSettingResourcePatch(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatch _autoscaleSettingResourceBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleSettingResourcePatch(); /// /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -72,6 +89,9 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter Enabled { get => _autoscaleSettingResourceBody.Enabled ?? default(global::System.Management.Automation.SwitchParameter); set => _autoscaleSettingResourceBody.Enabled = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -123,13 +143,13 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"the collection of notifications.", SerializedName = @"notifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] Notification { get => _autoscaleSettingResourceBody.Notification ?? null /* arrayOf */; set => _autoscaleSettingResourceBody.Notification = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[] Notification { get => _autoscaleSettingResourceBody.Notification?.ToArray() ?? null /* fixedArrayOf */; set => _autoscaleSettingResourceBody.Notification = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } /// /// the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in @@ -153,9 +173,9 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"the predictive autoscale mode", SerializedName = @"scaleMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode))] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode PredictiveAutoscalePolicyScaleMode { get => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode)""); set => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] + public string PredictiveAutoscalePolicyScaleMode { get => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode ?? null; set => _autoscaleSettingResourceBody.PredictiveAutoscalePolicyScaleMode = value; } /// /// the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum @@ -169,9 +189,8 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.", SerializedName = @"profiles", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile) })] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Profile", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] Profile { get => _autoscaleSettingResourceBody.Profile ?? null /* arrayOf */; set => _autoscaleSettingResourceBody.Profile = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[] Profile { get => _autoscaleSettingResourceBody.Profile?.ToArray() ?? null /* fixedArrayOf */; set => _autoscaleSettingResourceBody.Profile = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -198,8 +217,8 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags Tag { get => _autoscaleSettingResourceBody.Tag ?? null /* object */; set => _autoscaleSettingResourceBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags Tag { get => _autoscaleSettingResourceBody.Tag ?? null /* object */; set => _autoscaleSettingResourceBody.Tag = value; } /// the location of the resource that the autoscale setting should be added to. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "the location of the resource that the autoscale setting should be added to.")] @@ -230,24 +249,24 @@ public partial class UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded : global /// 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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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) @@ -270,6 +289,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -334,8 +358,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -391,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +455,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AutoscaleSettingsUpdateViaIdentity(InputObject.Id, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsUpdateViaIdentity(InputObject.Id, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate); } else { @@ -423,13 +472,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AutoscaleSettingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AutoscaleSettingsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline); + await this.Client.AutoscaleSettingsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, _autoscaleSettingResourceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_autoscaleSettingResourceBody}) + 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 } }); @@ -449,7 +498,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded() { @@ -475,12 +524,12 @@ public UpdateAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -497,15 +546,15 @@ public UpdateAzAutoscaleSetting_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.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_autoscaleSettingResourceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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=_autoscaleSettingResourceBody }) + 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 } }); @@ -515,12 +564,12 @@ public UpdateAzAutoscaleSetting_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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 ) { @@ -532,8 +581,26 @@ public UpdateAzAutoscaleSetting_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonFilePath.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..6b5f157b4a54 --- /dev/null +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonFilePath.cs @@ -0,0 +1,526 @@ +// 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.Autoscale.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; + using System; + + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAutoscaleSetting_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.NotSuggestDefaultParameterSet] + public partial class UpdateAzAutoscaleSetting_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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; + + /// Backing field for property. + private string _autoscaleSettingName; + + /// The autoscale setting name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The autoscale setting name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The autoscale setting name.", + SerializedName = @"autoscaleSettingName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] + public string AutoscaleSettingName { get => this._autoscaleSettingName; set => this._autoscaleSettingName = value; } + + /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AutoscaleSettingsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AutoscaleSettingsUpdateViaJsonString(SubscriptionId, ResourceGroupName, AutoscaleSettingName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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,AutoscaleSettingName=AutoscaleSettingName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzAutoscaleSetting_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.IAutoscaleErrorResponse + /// 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.Autoscale.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.Autoscale.Models.IAutoscaleSettingResource + /// 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.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaIdentity.cs b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonString.cs similarity index 72% rename from generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaIdentity.cs rename to generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonString.cs index 37bc55e06c4c..e100b14a86a7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/cmdlets/NewAzAutoscaleSetting_CreateViaIdentity.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/cmdlets/UpdateAzAutoscaleSetting_UpdateViaJsonString.cs @@ -6,20 +6,26 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Cmdlets; using System; - /// Creates or updates an autoscale setting. + /// + /// update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method. + /// /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzAutoscaleSetting_CreateViaIdentity", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Notification","Profile"}, NewOutputProperties=new string[] {"Notification","Profile"}, ChangeDescription="The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"Creates or updates an autoscale setting.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzAutoscaleSetting_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Description(@"update an existing AutoscaleSettingsResource. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.HttpPath(Path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}", ApiVersion = "2022-10-01")] - public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.NotSuggestDefaultParameterSet] + public partial class UpdateAzAutoscaleSetting_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +41,40 @@ public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Ma /// 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; + + /// Backing field for property. + private string _autoscaleSettingName; + + /// The autoscale setting name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The autoscale setting name.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The autoscale setting name.", + SerializedName = @"autoscaleSettingName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] + public string AutoscaleSettingName { get => this._autoscaleSettingName; set => this._autoscaleSettingName = value; } + /// 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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Autoscale Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.ClientAPI; @@ -53,6 +88,9 @@ public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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] @@ -65,17 +103,22 @@ public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// 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.Autoscale.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. /// @@ -84,23 +127,10 @@ public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Ma /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource _parameter; - - /// The autoscale setting resource. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The autoscale setting resource.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The autoscale setting resource.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource Parameter { get => this._parameter; set => this._parameter = value; } - /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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")] @@ -118,41 +148,62 @@ public partial class NewAzAutoscaleSetting_CreateViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// - /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource - /// 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 ) + /// Backing field for property. + private string _resourceGroupName; - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + /// 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.Autoscale.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.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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) @@ -175,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.Autoscale.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,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.Autoscale.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.Autoscale.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -249,14 +330,6 @@ protected override void EndProcessing() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public NewAzAutoscaleSetting_CreateViaIdentity() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -265,7 +338,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'AutoscaleSettingsCreateOrUpdate' operation")) + if (ShouldProcess($"Call remote 'AutoscaleSettingsUpdate' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token) ) { @@ -304,7 +377,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,32 +390,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.AutoscaleSettingsCreateOrUpdateViaIdentity(InputObject.Id, Parameter, onOk, onCreated, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.AutoscaleSettingName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AutoscaleSettingName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.AutoscaleSettingsCreateOrUpdate(InputObject.ResourceGroupName ?? null, InputObject.AutoscaleSettingName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, onCreated, onDefault, this, Pipeline); - } + await this.Client.AutoscaleSettingsUpdateViaJsonString(SubscriptionId, ResourceGroupName, AutoscaleSettingName, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AutoscaleSettingName=AutoscaleSettingName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,6 +414,14 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzAutoscaleSetting_UpdateViaJsonString() + { + + } + /// new protected void WriteObject(object sendToPipeline) { @@ -376,40 +437,16 @@ protected override void StopProcessing() 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource - /// 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.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); - } - } - /// /// 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.Autoscale.Models.Api20221001.IAutoscaleErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleErrorResponse /// 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 ) { @@ -426,15 +463,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.Autoscale.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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=Parameter }) + 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 } }); @@ -444,12 +481,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.Autoscale.Models.Api20221001.IAutoscaleSettingResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource /// 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 ) { @@ -461,8 +498,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource + 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/Autoscale.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..a3b46d984cda --- /dev/null +++ b/generated/Monitor/Autoscale.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.Autoscale +{ + 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/Autoscale.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..a7d40a84ea48 --- /dev/null +++ b/generated/Monitor/Autoscale.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.Autoscale +{ + 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/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 3cc0263b3043..c6083ab182f1 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 0835b20563db..f0440c2f8ddd 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/Autoscale.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.Autoscale.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 2b46d91044f0..73fcbb53043c 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 20ebca0d01ec..b50eb2a06f8f 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index eca78bdf4add..a55a1857d643 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 24455821ae77..6c6883a43ba7 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 5c0837046d0b..a3f513d3c9f9 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 605b7826185b..6055280cf559 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index ccf18c818ac1..7b7f12f17799 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 16e719b2556f..e1c875ef3d04 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsAttributes.cs index b19601ba49c3..2e8398b3da73 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsExtensions.cs index a5695a3c7cc4..a281063e9d54 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PowerShel { 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/Autoscale.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 02782c1c581d..f99b132b4b06 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/Context.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..08e836c99ee9 --- /dev/null +++ b/generated/Monitor/Autoscale.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.Autoscale.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.Autoscale.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.Autoscale.Autoscale Client { get; } + } +} diff --git a/generated/Monitor/Autoscale.Autorest/generated/runtime/Events.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/Events.cs index 52f771758e93..eedcc949118a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/ISendAsync.cs index a22b21cde492..83966f1bf824 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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/Autoscale.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/InfoAttribute.cs index c169e48d79f5..9ce78954aa45 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..6cf20b32ec6a --- /dev/null +++ b/generated/Monitor/Autoscale.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.Autoscale.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.Autoscale.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/Autoscale.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/MessageAttribute.cs index ed3439fa22f1..c622be247ca8 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.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.Autoscale" : @"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/Autoscale.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 29239f2d7807..1d742d438cc3 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/Autoscale.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/SerializationMode.cs index 9390d5d8b9e8..0df4de032d18 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/TypeConverterExtensions.cs index 6fb51f21db87..6d5b306e8fc2 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/Autoscale.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/Autoscale.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Monitor/Autoscale.Autorest/internal/ProxyCmdletDefinitions.ps1 index a3d994178cab..fd6cf74d710e 100644 --- a/generated/Monitor/Autoscale.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/Autoscale.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -16,18 +16,18 @@ <# .Synopsis -Updates an existing AutoscaleSettingsResource. -To update other fields use the CreateOrUpdate method. +Update an existing AutoscaleSettingsResource. +To update other fields use the CreateOrupdate method. .Description -Updates an existing AutoscaleSettingsResource. -To update other fields use the CreateOrUpdate method. +Update an existing AutoscaleSettingsResource. +To update other fields use the CreateOrupdate method. .Example Update-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesetting -Tag @{'key'='val'} -Enabled $true .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES @@ -40,10 +40,10 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. @@ -53,22 +53,22 @@ PROFILE : the collection of automatic scaling profiles that CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -76,25 +76,29 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/update-azautoscalesetting #> function Update-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The autoscale setting name. ${AutoscaleSettingName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The name of the resource group. @@ -102,6 +106,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -112,10 +118,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # 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.Autoscale.Category('Body')] [System.Management.Automation.SwitchParameter] # the enabled flag. @@ -123,62 +129,80 @@ param( # The default value is 'false'. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the name of the autoscale setting. ${Name}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. - # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.TimeSpan] # the amount of time to specify by which instances are launched in advance. # It must be between 1 minute and 60 minutes in ISO 8601 format. ${PredictiveAutoscalePolicyScaleLookAheadTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. - # To construct, see NOTES section for PROFILE properties and create a hash table. ${Profile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the location of the resource that the autoscale setting should be added to. ${TargetResourceLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the resource identifier of the resource that the autoscale setting should be added to. ${TargetResourceUri}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -235,14 +259,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Autoscale.private\Update-AzAutoscaleSetting_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.Autoscale.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 { @@ -251,6 +278,9 @@ begin { } $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/Autoscale.Autorest/internal/Update-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/internal/Update-AzAutoscaleSetting.ps1 index a3d994178cab..fd6cf74d710e 100644 --- a/generated/Monitor/Autoscale.Autorest/internal/Update-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/internal/Update-AzAutoscaleSetting.ps1 @@ -16,18 +16,18 @@ <# .Synopsis -Updates an existing AutoscaleSettingsResource. -To update other fields use the CreateOrUpdate method. +Update an existing AutoscaleSettingsResource. +To update other fields use the CreateOrupdate method. .Description -Updates an existing AutoscaleSettingsResource. -To update other fields use the CreateOrUpdate method. +Update an existing AutoscaleSettingsResource. +To update other fields use the CreateOrupdate method. .Example Update-AzAutoscaleSetting -ResourceGroupName test-group -Name test-autoscalesetting -Tag @{'key'='val'} -Enabled $true .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource .Notes COMPLEX PARAMETER PROPERTIES @@ -40,10 +40,10 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. NOTIFICATION : the collection of notifications. - [EmailCustomEmail ]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + [EmailCustomEmail >]: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. [EmailSendToSubscriptionAdministrator ]: a value indicating whether to send email to subscription administrator. [EmailSendToSubscriptionCoAdministrator ]: a value indicating whether to send email to subscription co-administrators. - [Webhook ]: the collection of webhook notifications. + [Webhook >]: the collection of webhook notifications. [Property ]: a property bag of settings. This value can be empty. [(Any) ]: This indicates any property can be added to this object. [ServiceUri ]: the service address to receive the notification. @@ -53,22 +53,22 @@ PROFILE : the collection of automatic scaling profiles that CapacityMaximum : 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. CapacityMinimum : the minimum number of instances for the resource. Name : the name of the profile. - Rule : the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + Rule >: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. MetricTriggerMetricName : the name of the metric that defines what the rule monitors. MetricTriggerMetricResourceUri : the resource identifier of the resource the rule monitors. - MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. - MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. + MetricTriggerOperator : the operator that is used to compare the metric data and the threshold. + MetricTriggerStatistic : the metric statistic type. How the metrics from multiple instances are combined. MetricTriggerThreshold : the threshold of the metric that triggers the scale action. - MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. + MetricTriggerTimeAggregation : time aggregation type. How the data that is collected should be combined over time. The default value is Average. MetricTriggerTimeGrain : 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. MetricTriggerTimeWindow : 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. ScaleActionCooldown : 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. - ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. - ScaleActionType : the type of action that should occur when the scale rule fires. - [MetricTriggerDimension ]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + ScaleActionDirection : the scale direction. Whether the scaling action increases or decreases the number of instances. + ScaleActionType : the type of action that should occur when the scale rule fires. + [MetricTriggerDimension >]: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. DimensionName : Name of the dimension. - Operator : 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 - Value : list of dimension values. For example: ["App1","App2"]. + Operator : 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 + Value >: list of dimension values. For example: ["App1","App2"]. [MetricTriggerDividePerInstance ]: a value indicating whether metric should divide per instance. [MetricTriggerMetricNamespace ]: the namespace of the metric that defines what the rule monitors. [MetricTriggerMetricResourceLocation ]: the location of the resource the rule monitors. @@ -76,25 +76,29 @@ PROFILE : the collection of automatic scaling profiles that [FixedDateEnd ]: the end time for the profile in ISO 8601 format. [FixedDateStart ]: the start time for the profile in ISO 8601 format. [FixedDateTimeZone ]: 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 - [RecurrenceFrequency ]: 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. - [ScheduleDay ]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. - [ScheduleHour ]: 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). - [ScheduleMinute ]: A collection of minutes at which the profile takes effect at. + [RecurrenceFrequency ]: 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. + [ScheduleDay >]: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + [ScheduleHour >]: 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). + [ScheduleMinute >]: A collection of minutes at which the profile takes effect at. [ScheduleTimeZone ]: 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 .Link https://learn.microsoft.com/powershell/module/az.monitor/update-azautoscalesetting #> function Update-AzAutoscaleSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The autoscale setting name. ${AutoscaleSettingName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [System.String] # The name of the resource group. @@ -102,6 +106,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -112,10 +118,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity] # 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.Autoscale.Category('Body')] [System.Management.Automation.SwitchParameter] # the enabled flag. @@ -123,62 +129,80 @@ param( # The default value is 'false'. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the name of the autoscale setting. ${Name}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]] # the collection of notifications. - # To construct, see NOTES section for NOTIFICATION properties and create a hash table. ${Notification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.TimeSpan] # the amount of time to specify by which instances are launched in advance. # It must be between 1 minute and 60 minutes in ISO 8601 format. ${PredictiveAutoscalePolicyScaleLookAheadTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode] + [System.String] # the predictive autoscale mode ${PredictiveAutoscalePolicyScaleMode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]] # the collection of automatic scaling profiles that specify different scaling parameters for different time periods. # A maximum of 20 profiles can be specified. - # To construct, see NOTES section for PROFILE properties and create a hash table. ${Profile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the location of the resource that the autoscale setting should be added to. ${TargetResourceLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] [System.String] # the resource identifier of the resource that the autoscale setting should be added to. ${TargetResourceUri}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -235,14 +259,17 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ UpdateExpanded = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Autoscale.private\Update-AzAutoscaleSetting_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Autoscale.private\Update-AzAutoscaleSetting_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.Autoscale.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 { @@ -251,6 +278,9 @@ begin { } $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/Autoscale.Autorest/test-module.ps1 b/generated/Monitor/Autoscale.Autorest/test-module.ps1 index 9a96adfa1ae8..6225069bc83b 100644 --- a/generated/Monitor/Autoscale.Autorest/test-module.ps1 +++ b/generated/Monitor/Autoscale.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/DiagnosticSetting.Autorest/Az.DiagnosticSetting.format.ps1xml b/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.format.ps1xml index 8dff4701a431..416ebacb82c0 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.format.ps1xml +++ b/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.format.ps1xml @@ -4,7 +4,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingIdentity#Multiple @@ -36,73 +36,57 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettings#Multiple - + - - - - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData - - - - + - + - + - + - + - + - CreatedAt + EventHubAuthorizationRuleId - CreatedBy + EventHubName - CreatedByType + LogAnalyticsDestinationType - LastModifiedAt + MarketplacePartnerId - LastModifiedBy + ServiceBusRuleId - LastModifiedByType + StorageAccountId + + + WorkspaceId @@ -110,57 +94,49 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategory - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategory#Multiple - - - - - - - - - - - - - + + + + + + + CategoryType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResource + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResource#Multiple + + + - + - + - EventHubAuthorizationRuleId - - - EventHubName - - - LogAnalyticsDestinationType - - - MarketplacePartnerId - - - ServiceBusRuleId - - - StorageAccountId + Name - WorkspaceId + ResourceGroupName @@ -168,27 +144,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategory + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategory + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource#Multiple - + - + - CategoryGroup + Name - CategoryType + ResourceGroupName @@ -196,21 +172,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse#Multiple - + + + + - Name + Code + + + Message @@ -218,21 +200,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LocalizableString - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LocalizableString#Multiple - + + + + - Name + LocalizedValue + + + Value @@ -240,9 +228,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings#Multiple @@ -274,9 +262,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings#Multiple @@ -302,9 +290,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy#Multiple @@ -330,9 +340,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettings#Multiple @@ -382,15 +392,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource#Multiple + + + @@ -398,15 +411,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings#Multiple @@ -438,55 +454,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData#Multiple - + - + - - - - - - Code - - - Message - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.LocalizableString - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.LocalizableString - - - - + - + + + + + + + - LocalizedValue + CreatedAt - Value + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType diff --git a/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psd1 b/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psd1 index d0bdada8ea55..391f1a67faf3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psd1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/Az.DiagnosticSetting.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.DiagnosticSetting.private.dll' FormatsToProcess = './Az.DiagnosticSetting.format.ps1xml' - FunctionsToExport = 'Get-AzDiagnosticSetting', 'Get-AzDiagnosticSettingCategory', 'Get-AzEventCategory', 'Get-AzSubscriptionDiagnosticSetting', 'New-AzDiagnosticSetting', 'New-AzDiagnosticSettingLogSettingsObject', 'New-AzDiagnosticSettingMetricSettingsObject', 'New-AzDiagnosticSettingSubscriptionLogSettingsObject', 'New-AzSubscriptionDiagnosticSetting', 'Remove-AzDiagnosticSetting', 'Remove-AzSubscriptionDiagnosticSetting', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzDiagnosticSetting', 'Get-AzDiagnosticSettingCategory', 'Get-AzEventCategory', 'Get-AzSubscriptionDiagnosticSetting', 'New-AzDiagnosticSetting', 'New-AzDiagnosticSettingLogSettingsObject', 'New-AzDiagnosticSettingMetricSettingsObject', 'New-AzDiagnosticSettingSubscriptionLogSettingsObject', 'New-AzSubscriptionDiagnosticSetting', 'Remove-AzDiagnosticSetting', 'Remove-AzSubscriptionDiagnosticSetting', 'Update-AzDiagnosticSetting', 'Update-AzSubscriptionDiagnosticSetting' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'DiagnosticSetting' diff --git a/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs index 2a232c23ffd2..fe75862408b6 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs @@ -23,5 +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)] - +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/check-dependencies.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 index 59b0c5f298ec..894a1b3e8379 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 @@ -29,7 +29,7 @@ Get-AzDiagnosticSetting -ResourceId /subscriptions/$subscriptionId/resourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azdiagnosticsetting #> function Get-AzDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -64,7 +64,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -123,6 +122,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -153,6 +161,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/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 index ec09aba7944b..20c1b040c7af 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 @@ -26,7 +26,7 @@ Get-AzDiagnosticSettingCategory -ResourceId /subscriptions/$subscriptionId/resou .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource .Notes COMPLEX PARAMETER PROPERTIES @@ -41,7 +41,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azdiagnosticsettingcategory #> function Get-AzDiagnosticSettingCategory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -61,7 +61,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -120,6 +119,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -150,6 +158,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/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 index 4a051188703b..bbf2f21534b8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 @@ -25,12 +25,12 @@ The current list includes the following: Administrative, Security, ServiceHealth Get-AzEventCategory .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString .Link https://learn.microsoft.com/powershell/module/az.monitor/get-azeventcategory #> function Get-AzEventCategory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,6 +89,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -117,6 +126,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/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 index 2facf378fcce..0b1f917cebea 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 @@ -27,7 +27,7 @@ Get-AzSubscriptionDiagnosticSetting -Name test-setting .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,7 +42,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azsubscriptiondiagnosticsetting #> function Get-AzSubscriptionDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -63,7 +63,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -122,6 +121,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -145,9 +153,7 @@ begin { GetViaIdentity = 'Az.DiagnosticSetting.private\Get-AzSubscriptionDiagnosticSetting_GetViaIdentity'; List = 'Az.DiagnosticSetting.private\Get-AzSubscriptionDiagnosticSetting_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -161,6 +167,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/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 index 580a6c139305..ff59d3db481a 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. .Description -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. .Example $subscriptionId = (Get-AzContext).Subscription.Id $metric = @() @@ -35,7 +35,7 @@ $categories | ForEach-Object {if($_.CategoryType -eq "Metrics"){$metric+=New-AzD New-AzDiagnosticSetting -Name test-setting -ResourceId /subscriptions/$subscriptionId/resourceGroups/test-rg-name/providers/Microsoft.AppPlatform/Spring/springcloud-001 -WorkspaceId /subscriptions/$subscriptionId/resourcegroups/test-rg-name/providers/microsoft.operationalinsights/workspaces/test-workspace -Log $log -Metric $metric .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -58,7 +58,7 @@ METRIC : The list of metric settings. https://learn.microsoft.com/powershell/module/az.monitor/new-azdiagnosticsetting #> function New-AzDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -73,28 +73,27 @@ param( # The identifier of the resource. ${ResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource Id for the event hub authorization rule. ${EventHubAuthorizationRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The name of the event hub. # If none is specified, the default event hub will be selected. ${EventHubName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[]] # The list of logs settings. - # To construct, see NOTES section for LOG properties and create a hash table. ${Log}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # A string indicating whether the export to Log Analytics should use the default destination type, i.e. @@ -102,40 +101,51 @@ param( # Possible values are: Dedicated and null (null is default.) ${LogAnalyticsDestinationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. ${MarketplacePartnerId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[]] # The list of metric settings. - # To construct, see NOTES section for METRIC properties and create a hash table. ${Metric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The service bus rule Id of the diagnostic setting. # This is here to maintain backwards compatibility. ${ServiceBusRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource ID of the storage account to which you would like to send Diagnostic Logs. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 ${WorkspaceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -192,6 +202,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -212,6 +231,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateExpanded'; + CreateViaJsonFilePath = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -220,6 +241,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/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingLogSettingsObject.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingLogSettingsObject.ps1 index 61708d83e877..755e17b44faf 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingLogSettingsObject.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingLogSettingsObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for LogSettings. New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category ContainerEventLogs -RetentionPolicyDay 7 -RetentionPolicyEnabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject #> function New-AzDiagnosticSettingLogSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -72,6 +72,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -100,6 +103,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/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingMetricSettingsObject.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingMetricSettingsObject.ps1 index fdb105d6168f..c5b348ed8442 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingMetricSettingsObject.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingMetricSettingsObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for MetricSettings. New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category AllMetrics -RetentionPolicyDay 7 -RetentionPolicyEnabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject #> function New-AzDiagnosticSettingMetricSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -71,6 +71,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -99,6 +102,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/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 index 6be563c4189e..2c60655229d4 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSettingSubscriptionLogSettingsObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for SubscriptionLogSettings. New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject #> function New-AzDiagnosticSettingSubscriptionLogSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -57,6 +57,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -85,6 +88,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/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 index 8772e8f02087..51e423926b73 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. .Description -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. .Example $subscriptionId = (Get-AzContext).Subscription.Id $log = @() @@ -26,7 +26,7 @@ $log += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommend New-AzSubscriptionDiagnosticSetting -Name test-setting -WorkspaceId /subscriptions/$subscriptionId/resourcegroups/test-rg-name/providers/microsoft.operationalinsights/workspaces/test-workspace -Log $log .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -40,7 +40,7 @@ LOG : The list of logs settings. https://learn.microsoft.com/powershell/module/az.monitor/new-azsubscriptiondiagnosticsetting #> function New-AzSubscriptionDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -56,53 +56,64 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource Id for the event hub authorization rule. ${EventHubAuthorizationRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The name of the event hub. # If none is specified, the default event hub will be selected. ${EventHubName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[]] # The list of logs settings. - # To construct, see NOTES section for LOG properties and create a hash table. ${Log}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. ${MarketplacePartnerId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The service bus rule Id of the diagnostic setting. # This is here to maintain backwards compatibility. ${ServiceBusRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource ID of the storage account to which you would like to send Diagnostic Logs. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 ${WorkspaceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -159,6 +170,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -179,10 +199,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_CreateExpanded'; + CreateViaJsonFilePath = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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 { @@ -196,6 +216,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/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 index d0a70aa441cc..8bca398ab92f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -26,7 +26,7 @@ Get-AzDiagnosticSettingCategory -ResourceId /subscriptions/$subscriptionId/resou .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource .Notes COMPLEX PARAMETER PROPERTIES @@ -41,7 +41,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azdiagnosticsettingcategory #> function Get-AzDiagnosticSettingCategory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -61,7 +61,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -120,6 +119,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -150,6 +158,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) @@ -208,7 +219,7 @@ Get-AzDiagnosticSetting -ResourceId /subscriptions/$subscriptionId/resourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -223,7 +234,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azdiagnosticsetting #> function Get-AzDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -243,7 +254,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -302,6 +312,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -332,6 +351,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) @@ -386,12 +408,12 @@ The current list includes the following: Administrative, Security, ServiceHealth Get-AzEventCategory .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString .Link https://learn.microsoft.com/powershell/module/az.monitor/get-azeventcategory #> function Get-AzEventCategory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -450,6 +472,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -478,6 +509,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) @@ -534,7 +568,7 @@ Get-AzSubscriptionDiagnosticSetting -Name test-setting .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -549,7 +583,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azsubscriptiondiagnosticsetting #> function Get-AzSubscriptionDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -570,7 +604,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -629,6 +662,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -652,9 +694,7 @@ begin { GetViaIdentity = 'Az.DiagnosticSetting.private\Get-AzSubscriptionDiagnosticSetting_GetViaIdentity'; List = 'Az.DiagnosticSetting.private\Get-AzSubscriptionDiagnosticSetting_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -668,6 +708,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) @@ -713,9 +756,9 @@ end { <# .Synopsis -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. .Description -Creates or updates diagnostic settings for the specified resource. +Create diagnostic settings for the specified resource. .Example $subscriptionId = (Get-AzContext).Subscription.Id $metric = @() @@ -732,7 +775,7 @@ $categories | ForEach-Object {if($_.CategoryType -eq "Metrics"){$metric+=New-AzD New-AzDiagnosticSetting -Name test-setting -ResourceId /subscriptions/$subscriptionId/resourceGroups/test-rg-name/providers/Microsoft.AppPlatform/Spring/springcloud-001 -WorkspaceId /subscriptions/$subscriptionId/resourcegroups/test-rg-name/providers/microsoft.operationalinsights/workspaces/test-workspace -Log $log -Metric $metric .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -755,7 +798,7 @@ METRIC : The list of metric settings. https://learn.microsoft.com/powershell/module/az.monitor/new-azdiagnosticsetting #> function New-AzDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -770,28 +813,27 @@ param( # The identifier of the resource. ${ResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource Id for the event hub authorization rule. ${EventHubAuthorizationRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The name of the event hub. # If none is specified, the default event hub will be selected. ${EventHubName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[]] # The list of logs settings. - # To construct, see NOTES section for LOG properties and create a hash table. ${Log}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # A string indicating whether the export to Log Analytics should use the default destination type, i.e. @@ -799,40 +841,51 @@ param( # Possible values are: Dedicated and null (null is default.) ${LogAnalyticsDestinationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. ${MarketplacePartnerId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[]] # The list of metric settings. - # To construct, see NOTES section for METRIC properties and create a hash table. ${Metric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The service bus rule Id of the diagnostic setting. # This is here to maintain backwards compatibility. ${ServiceBusRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource ID of the storage account to which you would like to send Diagnostic Logs. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 ${WorkspaceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -889,6 +942,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -909,6 +971,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateExpanded'; + CreateViaJsonFilePath = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.DiagnosticSetting.private\New-AzDiagnosticSetting_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -917,6 +981,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) @@ -962,9 +1029,9 @@ end { <# .Synopsis -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. .Description -Creates or updates subscription diagnostic settings for the specified resource. +Create subscription diagnostic settings for the specified resource. .Example $subscriptionId = (Get-AzContext).Subscription.Id $log = @() @@ -972,7 +1039,7 @@ $log += New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommend New-AzSubscriptionDiagnosticSetting -Name test-setting -WorkspaceId /subscriptions/$subscriptionId/resourcegroups/test-rg-name/providers/microsoft.operationalinsights/workspaces/test-workspace -Log $log .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource .Notes COMPLEX PARAMETER PROPERTIES @@ -986,7 +1053,7 @@ LOG : The list of logs settings. https://learn.microsoft.com/powershell/module/az.monitor/new-azsubscriptiondiagnosticsetting #> function New-AzSubscriptionDiagnosticSetting { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1002,53 +1069,64 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource Id for the event hub authorization rule. ${EventHubAuthorizationRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The name of the event hub. # If none is specified, the default event hub will be selected. ${EventHubName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[]] # The list of logs settings. - # To construct, see NOTES section for LOG properties and create a hash table. ${Log}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. ${MarketplacePartnerId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The service bus rule Id of the diagnostic setting. # This is here to maintain backwards compatibility. ${ServiceBusRuleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The resource ID of the storage account to which you would like to send Diagnostic Logs. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] [System.String] # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 ${WorkspaceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1105,6 +1183,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1125,10 +1212,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_CreateExpanded'; + CreateViaJsonFilePath = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.DiagnosticSetting.private\New-AzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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 { @@ -1142,6 +1229,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) @@ -1231,7 +1321,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1296,6 +1385,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1325,6 +1423,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) @@ -1414,7 +1515,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1479,6 +1579,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1501,9 +1610,7 @@ begin { Delete = 'Az.DiagnosticSetting.private\Remove-AzSubscriptionDiagnosticSetting_Delete'; DeleteViaIdentity = 'Az.DiagnosticSetting.private\Remove-AzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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 { @@ -1517,6 +1624,520 @@ 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) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update diagnostic settings for the specified resource. +.Description +Update diagnostic settings for the specified resource. +.Example +$newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category 'VMProtectionAlerts' +$newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category 'AllMetrics' +Update-AzDiagnosticSetting -Name diagnosticSettingName -ResourceId 'vnetId' -Log $newlog -Metric $newmetric + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [Name ]: The name of the diagnostic setting. + [ResourceUri ]: The identifier of the resource. + [SubscriptionId ]: The ID of the target subscription. + +LOG : The list of logs settings. + Enabled : a value indicating whether this log is enabled. + [Category ]: Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + [CategoryGroup ]: Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + [RetentionPolicyDay ]: the number of days for the retention in days. A value of 0 will retain the events indefinitely. + [RetentionPolicyEnabled ]: a value indicating whether the retention policy is enabled. + +METRIC : The list of metric settings. + Enabled : a value indicating whether this category is enabled. + [Category ]: Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation. + [RetentionPolicyDay ]: the number of days for the retention in days. A value of 0 will retain the events indefinitely. + [RetentionPolicyEnabled ]: a value indicating whether the retention policy is enabled. + [TimeGrain ]: the timegrain of the metric in ISO8601 format. +.Link +https://learn.microsoft.com/powershell/module/az.monitor/update-azdiagnosticsetting +#> +function Update-AzDiagnosticSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The name of the diagnostic setting. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The identifier of the resource. + ${ResourceId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource Id for the event hub authorization rule. + ${EventHubAuthorizationRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The name of the event hub. + # If none is specified, the default event hub will be selected. + ${EventHubName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[]] + # The list of logs settings. + ${Log}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # A string indicating whether the export to Log Analytics should use the default destination type, i.e. + # AzureDiagnostics, or use a destination type constructed as follows: _. + # Possible values are: Dedicated and null (null is default.) + ${LogAnalyticsDestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + ${MarketplacePartnerId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[]] + # The list of metric settings. + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The service bus rule Id of the diagnostic setting. + # This is here to maintain backwards compatibility. + ${ServiceBusRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource ID of the storage account to which you would like to send Diagnostic Logs. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. + # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + ${WorkspaceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DiagnosticSetting.private\Update-AzDiagnosticSetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DiagnosticSetting.private\Update-AzDiagnosticSetting_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update subscription diagnostic settings for the specified resource. +.Description +Update subscription diagnostic settings for the specified resource. +.Example +$log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true +Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [Name ]: The name of the diagnostic setting. + [ResourceUri ]: The identifier of the resource. + [SubscriptionId ]: The ID of the target subscription. + +LOG : The list of logs settings. + Enabled : a value indicating whether this log is enabled. + [Category ]: Name of a Subscription Diagnostic Log category for a resource type this setting is applied to. + [CategoryGroup ]: Name of a Subscription Diagnostic Log category group for a resource type this setting is applied to. +.Link +https://learn.microsoft.com/powershell/module/az.monitor/update-azsubscriptiondiagnosticsetting +#> +function Update-AzSubscriptionDiagnosticSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The name of the diagnostic setting. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource Id for the event hub authorization rule. + ${EventHubAuthorizationRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The name of the event hub. + # If none is specified, the default event hub will be selected. + ${EventHubName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[]] + # The list of logs settings. + ${Log}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + ${MarketplacePartnerId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The service bus rule Id of the diagnostic setting. + # This is here to maintain backwards compatibility. + ${ServiceBusRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource ID of the storage account to which you would like to send Diagnostic Logs. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. + # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + ${WorkspaceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DiagnosticSetting.private\Update-AzSubscriptionDiagnosticSetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DiagnosticSetting.private\Update-AzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1569,12 +2190,12 @@ Create an in-memory object for LogSettings. New-AzDiagnosticSettingLogSettingsObject -Enabled $true -Category ContainerEventLogs -RetentionPolicyDay 7 -RetentionPolicyEnabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettinglogsettingsobject #> function New-AzDiagnosticSettingLogSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1618,6 +2239,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1646,6 +2270,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) @@ -1698,12 +2325,12 @@ Create an in-memory object for MetricSettings. New-AzDiagnosticSettingMetricSettingsObject -Enabled $true -Category AllMetrics -RetentionPolicyDay 7 -RetentionPolicyEnabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingmetricsettingsobject #> function New-AzDiagnosticSettingMetricSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1746,6 +2373,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1774,6 +2404,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) @@ -1826,12 +2459,12 @@ Create an in-memory object for SubscriptionLogSettings. New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingSubscriptionLogSettingsObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azdiagnosticsettingsubscriptionlogsettingsobject #> function New-AzDiagnosticSettingSubscriptionLogSettingsObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1860,6 +2493,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1888,6 +2524,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/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 index 4af3b04c591e..d1fb99a116bb 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 @@ -60,7 +60,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -125,6 +124,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -154,6 +162,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/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 index 2aaf73f26290..d8c6dc3ab622 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 @@ -60,7 +60,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -125,6 +124,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -147,9 +155,7 @@ begin { Delete = 'Az.DiagnosticSetting.private\Remove-AzSubscriptionDiagnosticSetting_Delete'; DeleteViaIdentity = 'Az.DiagnosticSetting.private\Remove-AzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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 { @@ -163,6 +169,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/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 new file mode 100644 index 000000000000..b228034e193a --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 @@ -0,0 +1,279 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update diagnostic settings for the specified resource. +.Description +Update diagnostic settings for the specified resource. +.Example +$newlog = New-AzDiagnosticSettingLogSettingsObject -Enabled $false -Category 'VMProtectionAlerts' +$newmetric = New-AzDiagnosticSettingMetricSettingsObject -Enabled $false -Category 'AllMetrics' +Update-AzDiagnosticSetting -Name diagnosticSettingName -ResourceId 'vnetId' -Log $newlog -Metric $newmetric + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [Name ]: The name of the diagnostic setting. + [ResourceUri ]: The identifier of the resource. + [SubscriptionId ]: The ID of the target subscription. + +LOG : The list of logs settings. + Enabled : a value indicating whether this log is enabled. + [Category ]: Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + [CategoryGroup ]: Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. + [RetentionPolicyDay ]: the number of days for the retention in days. A value of 0 will retain the events indefinitely. + [RetentionPolicyEnabled ]: a value indicating whether the retention policy is enabled. + +METRIC : The list of metric settings. + Enabled : a value indicating whether this category is enabled. + [Category ]: Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation. + [RetentionPolicyDay ]: the number of days for the retention in days. A value of 0 will retain the events indefinitely. + [RetentionPolicyEnabled ]: a value indicating whether the retention policy is enabled. + [TimeGrain ]: the timegrain of the metric in ISO8601 format. +.Link +https://learn.microsoft.com/powershell/module/az.monitor/update-azdiagnosticsetting +#> +function Update-AzDiagnosticSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The name of the diagnostic setting. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The identifier of the resource. + ${ResourceId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource Id for the event hub authorization rule. + ${EventHubAuthorizationRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The name of the event hub. + # If none is specified, the default event hub will be selected. + ${EventHubName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[]] + # The list of logs settings. + ${Log}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # A string indicating whether the export to Log Analytics should use the default destination type, i.e. + # AzureDiagnostics, or use a destination type constructed as follows: _. + # Possible values are: Dedicated and null (null is default.) + ${LogAnalyticsDestinationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + ${MarketplacePartnerId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[]] + # The list of metric settings. + ${Metric}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The service bus rule Id of the diagnostic setting. + # This is here to maintain backwards compatibility. + ${ServiceBusRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource ID of the storage account to which you would like to send Diagnostic Logs. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. + # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + ${WorkspaceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DiagnosticSetting.private\Update-AzDiagnosticSetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DiagnosticSetting.private\Update-AzDiagnosticSetting_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 new file mode 100644 index 000000000000..d1ef3665f3bc --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 @@ -0,0 +1,262 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update subscription diagnostic settings for the specified resource. +.Description +Update subscription diagnostic settings for the specified resource. +.Example +$log = New-AzDiagnosticSettingSubscriptionLogSettingsObject -Category Recommendation -Enabled $true +Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [Name ]: The name of the diagnostic setting. + [ResourceUri ]: The identifier of the resource. + [SubscriptionId ]: The ID of the target subscription. + +LOG : The list of logs settings. + Enabled : a value indicating whether this log is enabled. + [Category ]: Name of a Subscription Diagnostic Log category for a resource type this setting is applied to. + [CategoryGroup ]: Name of a Subscription Diagnostic Log category group for a resource type this setting is applied to. +.Link +https://learn.microsoft.com/powershell/module/az.monitor/update-azsubscriptiondiagnosticsetting +#> +function Update-AzSubscriptionDiagnosticSetting { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [System.String] + # The name of the diagnostic setting. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource Id for the event hub authorization rule. + ${EventHubAuthorizationRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The name of the event hub. + # If none is specified, the default event hub will be selected. + ${EventHubName}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[]] + # The list of logs settings. + ${Log}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + ${MarketplacePartnerId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The service bus rule Id of the diagnostic setting. + # This is here to maintain backwards compatibility. + ${ServiceBusRuleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The resource ID of the storage account to which you would like to send Diagnostic Logs. + ${StorageAccountId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Body')] + [System.String] + # The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. + # Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + ${WorkspaceId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.DiagnosticSetting.private\Update-AzSubscriptionDiagnosticSetting_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.DiagnosticSetting.private\Update-AzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generate-info.json b/generated/Monitor/DiagnosticSetting.Autorest/generate-info.json index df09006b862a..b9cc139fe3dc 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generate-info.json +++ b/generated/Monitor/DiagnosticSetting.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "a61cca1c-3798-4b51-9d48-f8981ebf9903" + "generate_Id": "8e81e4bb-8582-47ce-9295-c9a7726e77cc" } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/Module.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/Module.cs index ca7959a2f68f..53c296ab2dec 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/Module.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting"; + 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.DiagnosticSetting"; + 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.DiagnosticSetting.Runtime.Http /// 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/DiagnosticSetting.Autorest/generated/api/DiagnosticSetting.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/DiagnosticSetting.cs index b16df91611ba..8e1617589cce 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/DiagnosticSetting.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/DiagnosticSetting.cs @@ -24,7 +24,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGet(string resourceUri, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGet(string resourceUri, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -49,7 +49,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCategoryGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCategoryGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -63,7 +63,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -99,11 +99,159 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCategoryGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCategoryGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Gets the diagnostic settings category for the specified resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCategoryGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettingsCategories/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var name = _match.Groups["name"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettingsCategories/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCategoryGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the diagnostic settings category for the specified resource. + /// The identifier of the resource. + /// The name of the diagnostic setting. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCategoryGetWithResult(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettingsCategories/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCategoryGetWithResult_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.DiagnosticSetting.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 DiagnosticSettingsCategoryGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 @@ -113,7 +261,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -124,6 +272,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -131,13 +280,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -181,7 +330,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -205,7 +354,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCategoryList_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCategoryList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -219,7 +368,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -253,11 +402,155 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCategoryList_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCategoryList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists the diagnostic settings categories for the specified resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCategoryListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettingsCategories$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettingsCategories" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCategoryListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists the diagnostic settings categories for the specified resource. + /// The identifier of the resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCategoryListWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettingsCategories" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCategoryListWithResult_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.DiagnosticSetting.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 DiagnosticSettingsCategoryListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 @@ -267,7 +560,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsCategoryList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -278,6 +571,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -285,13 +579,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -323,7 +617,7 @@ public partial class DiagnosticSetting } } - /// Creates or updates diagnostic settings for the specified resource. + /// update diagnostic settings for the specified resource. /// The identifier of the resource. /// The name of the diagnostic setting. /// Parameters supplied to the operation. @@ -332,10 +626,11 @@ public partial class DiagnosticSetting /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCreateOrUpdate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -360,15 +655,15 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates diagnostic settings for the specified resource. + /// update diagnostic settings for the specified resource. /// /// Parameters supplied to the operation. /// a delegate that is called when the remote service returns 200 (OK). @@ -376,10 +671,11 @@ public partial class DiagnosticSetting /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -415,90 +711,73 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update diagnostic settings for the specified resource. + /// + /// Parameters supplied to the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdate_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The identifier of the resource. - /// The name of the diagnostic setting. - /// Parameters supplied to the operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdate_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(name),name); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var name = _match.Groups["name"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettings/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Deletes existing diagnostic settings for the specified resource. + /// update diagnostic settings for the specified resource. /// The identifier of the resource. /// The name of the diagnostic setting. + /// Json string supplied to the DiagnosticSettingsCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -506,7 +785,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsDelete(string resourceUri, string name, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdateViaJsonString(string resourceUri, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -526,70 +805,171 @@ public partial class DiagnosticSetting // 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.DiagnosticSetting.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.DiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes existing diagnostic settings for the specified resource. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update diagnostic settings for the specified resource. + /// The identifier of the resource. + /// The name of the diagnostic setting. + /// Json string supplied to the DiagnosticSettingsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdateViaJsonStringWithResult(string resourceUri, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - var name = _match.Groups["name"].Value; + // 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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update diagnostic settings for the specified resource. + /// The identifier of the resource. + /// The name of the diagnostic setting. + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsCreateOrUpdateWithResult(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + resourceUri + + (resourceUri) + "/providers/Microsoft.Insights/diagnosticSettings/" - + name + + global::System.Uri.EscapeDataString(name) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DiagnosticSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.DiagnosticSettingsCreateOrUpdateWithResult_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.DiagnosticSetting.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 DiagnosticSettingsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -597,7 +977,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdate_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -608,6 +988,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -615,19 +996,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -643,28 +1018,32 @@ public partial class DiagnosticSetting } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The identifier of the resource. /// The name of the diagnostic setting. + /// Parameters supplied to the operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsDelete_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsCreateOrUpdate_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); await eventListener.AssertNotNull(nameof(name),name); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets the active diagnostic settings for the specified resource. + /// Deletes existing diagnostic settings for the specified resource. /// The identifier of the resource. /// The name of the diagnostic setting. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -672,7 +1051,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsGet(string resourceUri, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsDelete(string resourceUri, string name, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -692,18 +1071,19 @@ public partial class DiagnosticSetting // 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.DiagnosticSetting.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Gets the active diagnostic settings for the specified resource. + /// Deletes existing diagnostic settings for the specified resource. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -711,7 +1091,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -742,18 +1122,19 @@ public partial class DiagnosticSetting // 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.DiagnosticSetting.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -761,7 +1142,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -772,6 +1153,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -779,13 +1161,19 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -801,8 +1189,8 @@ public partial class DiagnosticSetting } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The identifier of the resource. /// The name of the diagnostic setting. @@ -810,7 +1198,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsGet_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DiagnosticSettingsDelete_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -819,8 +1207,9 @@ public partial class DiagnosticSetting } } - /// Gets the active diagnostic settings list for the specified resource. + /// Gets the active diagnostic settings for the specified resource. /// The identifier of the resource. + /// The name of the diagnostic setting. /// 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). @@ -829,7 +1218,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsGet(string resourceUri, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -839,7 +1228,8 @@ public partial class DiagnosticSetting var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (resourceUri) - + "/providers/Microsoft.Insights/diagnosticSettings" + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -853,11 +1243,11 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsList_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the active diagnostic settings list for the specified resource. + /// Gets the active diagnostic settings for the specified resource. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -867,7 +1257,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DiagnosticSettingsListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -875,19 +1265,21 @@ public partial class DiagnosticSetting { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings'"); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); } // replace URI parameters with values from identity var resourceUri = _match.Groups["resourceUri"].Value; + var name = _match.Groups["name"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + resourceUri - + "/providers/Microsoft.Insights/diagnosticSettings" + + "/providers/Microsoft.Insights/diagnosticSettings/" + + name + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -901,74 +1293,518 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DiagnosticSettingsList_Call(request,onOk,onDefault,eventListener,sender); + await this.DiagnosticSettingsGet_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). + /// Gets the active diagnostic settings for the specified resource. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DiagnosticSettingsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The identifier of the resource. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task DiagnosticSettingsList_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - } + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + var name = _match.Groups["name"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettings/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the active diagnostic settings for the specified resource. + /// The identifier of the resource. + /// The name of the diagnostic setting. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsGetWithResult(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsGetWithResult_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.DiagnosticSetting.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 DiagnosticSettingsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 DiagnosticSettingsGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The identifier of the resource. + /// The name of the diagnostic setting. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticSettingsGet_Validate(string resourceUri, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(name),name); + } + } + + /// Gets the active diagnostic settings list for the specified resource. + /// The identifier of the resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsList(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the active diagnostic settings list for the specified resource. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DiagnosticSettingsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the active diagnostic settings list for the specified resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings'"); + } + + // replace URI parameters with values from identity + var resourceUri = _match.Groups["resourceUri"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + resourceUri + + "/providers/Microsoft.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsListWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the active diagnostic settings list for the specified resource. + /// The identifier of the resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 DiagnosticSettingsListWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (resourceUri) + + "/providers/Microsoft.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DiagnosticSettingsListWithResult_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.DiagnosticSetting.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 DiagnosticSettingsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 DiagnosticSettingsList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The identifier of the resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DiagnosticSettingsList_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + } } /// @@ -983,7 +1819,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EventCategoriesList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EventCategoriesList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2015-04-01"; // Constant Parameters @@ -1005,7 +1841,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EventCategoriesList_Call(request,onOk,onDefault,eventListener,sender); + await this.EventCategoriesList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1022,7 +1858,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EventCategoriesListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EventCategoriesListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2015-04-01"; // Constant Parameters @@ -1053,11 +1889,153 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EventCategoriesList_Call(request,onOk,onDefault,eventListener,sender); + await this.EventCategoriesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: + /// Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + ///
+ /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 EventCategoriesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Insights/eventcategories$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Insights/eventcategories'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Insights/eventcategories" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EventCategoriesListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: + /// Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. + ///
+ /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 EventCategoriesListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2015-04-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Insights/eventcategories" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EventCategoriesListWithResult_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.DiagnosticSetting.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 EventCategoriesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.EventCategoryCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 @@ -1067,7 +2045,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task EventCategoriesList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task EventCategoriesList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1078,6 +2056,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1085,13 +2064,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.EventCategoryCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.EventCategoryCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1122,7 +2101,7 @@ public partial class DiagnosticSetting } } - /// Creates or updates subscription diagnostic settings for the specified resource. + /// update subscription diagnostic settings for the specified resource. /// The ID of the target subscription. /// The name of the diagnostic setting. /// Parameters supplied to the operation. @@ -1131,10 +2110,11 @@ public partial class DiagnosticSetting /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdate(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdate(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1159,15 +2139,15 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates or updates subscription diagnostic settings for the specified resource. + /// update subscription diagnostic settings for the specified resource. /// /// Parameters supplied to the operation. /// a delegate that is called when the remote service returns 200 (OK). @@ -1175,10 +2155,65 @@ public partial class DiagnosticSetting /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var name = _match.Groups["name"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Insights/diagnosticSettings/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionDiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update subscription diagnostic settings for the specified resource. + /// + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1205,6 +2240,51 @@ public partial class DiagnosticSetting + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update subscription diagnostic settings for the specified resource. + /// The ID of the target subscription. + /// The name of the diagnostic setting. + /// Json string supplied to the SubscriptionDiagnosticSettingsCreateOrUpdate 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.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateViaJsonString(string subscriptionId, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -1214,16 +2294,165 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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(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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SubscriptionDiagnosticSettingsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update subscription diagnostic settings for the specified resource. + /// The ID of the target subscription. + /// The name of the diagnostic setting. + /// Json string supplied to the SubscriptionDiagnosticSettingsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update subscription diagnostic settings for the specified resource. + /// The ID of the target subscription. + /// The name of the diagnostic setting. + /// Parameters supplied to the operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateWithResult(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.SubscriptionDiagnosticSettingsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.SubscriptionDiagnosticSettingsCreateOrUpdateWithResult_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.DiagnosticSetting.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 SubscriptionDiagnosticSettingsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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). @@ -1234,7 +2463,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdate_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdate_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1245,6 +2474,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1252,13 +2482,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1284,7 +2514,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdate_Validate(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsCreateOrUpdate_Validate(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1308,7 +2538,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDelete(string subscriptionId, string name, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDelete(string subscriptionId, string name, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1333,7 +2563,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -1348,7 +2578,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1384,12 +2614,12 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -1401,7 +2631,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1412,6 +2642,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1431,7 +2662,7 @@ public partial class DiagnosticSetting default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1477,7 +2708,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGet(string subscriptionId, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGet(string subscriptionId, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1502,7 +2733,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1516,7 +2747,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGetViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1552,11 +2783,159 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the active subscription diagnostic settings for the specified resource. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var name = _match.Groups["name"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Insights/diagnosticSettings/" + + name + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the active subscription diagnostic settings for the specified resource. + /// The ID of the target subscription. + /// The name of the diagnostic setting. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsGetWithResult(string subscriptionId, string name, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/diagnosticSettings/" + + global::System.Uri.EscapeDataString(name) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsGetWithResult_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.DiagnosticSetting.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 SubscriptionDiagnosticSettingsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 @@ -1566,7 +2945,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsGet_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1577,6 +2956,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1584,13 +2964,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1637,7 +3017,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsList(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsList(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1661,7 +3041,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsList_Call(request,onOk,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1677,7 +3057,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsListViaIdentity(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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { var apiVersion = @"2021-05-01-preview"; // Constant Parameters @@ -1711,11 +3091,159 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SubscriptionDiagnosticSettingsList_Call(request,onOk,onDefault,eventListener,sender); + await this.SubscriptionDiagnosticSettingsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the active subscription diagnostic settings list for the specified subscriptionId. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/diagnosticSettings$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings'"); + } + + // 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.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets the active subscription diagnostic settings list for the specified subscriptionId. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 SubscriptionDiagnosticSettingsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-05-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/diagnosticSettings" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.SubscriptionDiagnosticSettingsListWithResult_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.DiagnosticSetting.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 SubscriptionDiagnosticSettingsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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 @@ -1725,7 +3253,7 @@ public partial class DiagnosticSetting /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task SubscriptionDiagnosticSettingsList_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.DiagnosticSetting.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1736,6 +3264,7 @@ public partial class DiagnosticSetting await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1743,13 +3272,13 @@ public partial class DiagnosticSetting case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.PowerShell.cs deleted file mode 100644 index d30e592fefb0..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.PowerShell.cs +++ /dev/null @@ -1,264 +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.DiagnosticSetting.Models.Api20210501Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; - - /// The diagnostic settings category resource. - [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsCategoryResourceTypeConverter))] - public partial class DiagnosticSettingsCategoryResource - { - - /// - /// 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DiagnosticSettingsCategoryResource(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("CategoryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType?) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)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("CategoryGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup = (string[]) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)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 . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("CategoryType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType?) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)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("CategoryGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup = (string[]) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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 diagnostic settings category resource. - [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsCategoryResourceTypeConverter))] - public partial interface IDiagnosticSettingsCategoryResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.PowerShell.cs deleted file mode 100644 index 66aa71a23a83..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.PowerShell.cs +++ /dev/null @@ -1,318 +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.DiagnosticSetting.Models.Api20210501Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; - - /// The diagnostic setting resource. - [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsResourceTypeConverter))] - public partial class DiagnosticSettingsResource - { - - /// - /// 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new DiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new DiagnosticSettingsResource(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal DiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)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("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("ServiceBusRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubAuthorizationRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Metric, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("Log")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("WorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("MarketplacePartnerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); - } - if (content.Contains("LogAnalyticsDestinationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)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 . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal DiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)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("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("ServiceBusRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubAuthorizationRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Metric, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("Log")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("WorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("MarketplacePartnerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); - } - if (content.Contains("LogAnalyticsDestinationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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 diagnostic setting resource. - [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsResourceTypeConverter))] - public partial interface IDiagnosticSettingsResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.PowerShell.cs deleted file mode 100644 index 126d9405c7c3..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.PowerShell.cs +++ /dev/null @@ -1,305 +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.DiagnosticSetting.Models.Api20210501Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; - - /// The subscription diagnostic setting resource. - [System.ComponentModel.TypeConverter(typeof(SubscriptionDiagnosticSettingsResourceTypeConverter))] - public partial class SubscriptionDiagnosticSettingsResource - { - - /// - /// 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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)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("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("ServiceBusRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubAuthorizationRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); - } - if (content.Contains("Log")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("WorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("MarketplacePartnerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)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 . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)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("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("ServiceBusRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubAuthorizationRuleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); - } - if (content.Contains("EventHubName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); - } - if (content.Contains("Log")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettingsTypeConverter.ConvertFrom)); - } - if (content.Contains("WorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("MarketplacePartnerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - 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.DiagnosticSetting.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 subscription diagnostic setting resource. - [System.ComponentModel.TypeConverter(typeof(SubscriptionDiagnosticSettingsResourceTypeConverter))] - public partial interface ISubscriptionDiagnosticSettingsResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.cs index e4280a81ff15..fdaff832170e 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.cs @@ -53,6 +53,9 @@ public partial interface IDiagnosticSettingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IDiagnosticSettingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the diagnostic setting.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IDiagnosticSettingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identifier of the resource.", SerializedName = @"resourceUri", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IDiagnosticSettingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.json.cs index faf126549554..c88aaf22cd16 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingIdentity.json.cs @@ -64,10 +64,10 @@ internal DiagnosticSettingIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Di { return; } - {_resourceUri = If( json?.PropertyT("resourceUri"), out var __jsonResourceUri) ? (string)__jsonResourceUri : (string)ResourceUri;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_resourceUri = If( json?.PropertyT("resourceUri"), out var __jsonResourceUri) ? (string)__jsonResourceUri : (string)_resourceUri;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.PowerShell.cs similarity index 55% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.PowerShell.cs index 61e5b2af9b04..3874c12e4d2b 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class DiagnosticSettings 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DiagnosticSettings(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DiagnosticSettings(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,45 +104,45 @@ internal DiagnosticSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("StorageAccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); } if (content.Contains("ServiceBusRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubAuthorizationRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Metric, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Metric = (System.Collections.Generic.List) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Metric, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettingsTypeConverter.ConvertFrom)); } if (content.Contains("Log")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettingsTypeConverter.ConvertFrom)); } if (content.Contains("WorkspaceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); } if (content.Contains("MarketplacePartnerId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); } if (content.Contains("LogAnalyticsDestinationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType, 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. @@ -159,39 +157,39 @@ internal DiagnosticSettings(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("StorageAccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); } if (content.Contains("ServiceBusRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubAuthorizationRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[]) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Metric, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Metric = (System.Collections.Generic.List) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Metric, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettingsTypeConverter.ConvertFrom)); } if (content.Contains("Log")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettingsTypeConverter.ConvertFrom)); } if (content.Contains("WorkspaceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); } if (content.Contains("MarketplacePartnerId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); } if (content.Contains("LogAnalyticsDestinationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -201,7 +199,7 @@ internal DiagnosticSettings(global::System.Management.Automation.PSObject conten ///
/// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.TypeConverter.cs index 18751251c9cf..704c49a084a1 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.cs similarity index 86% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.cs index 60cf422b0e8e..a72ad84178f0 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The diagnostic settings. public partial class DiagnosticSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal { /// Backing field for property. @@ -30,11 +30,11 @@ public partial class DiagnosticSettings : public string EventHubName { get => this._eventHubName; set => this._eventHubName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] _log; + private System.Collections.Generic.List _log; /// The list of logs settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get => this._log; set => this._log = value; } + public System.Collections.Generic.List Log { get => this._log; set => this._log = value; } /// Backing field for property. private string _logAnalyticsDestinationType; @@ -57,11 +57,11 @@ public partial class DiagnosticSettings : public string MarketplacePartnerId { get => this._marketplacePartnerId; set => this._marketplacePartnerId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] _metric; + private System.Collections.Generic.List _metric; /// The list of metric settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get => this._metric; set => this._metric = value; } + public System.Collections.Generic.List Metric { get => this._metric; set => this._metric = value; } /// Backing field for property. private string _serviceBusRuleId; @@ -104,6 +104,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id for the event hub authorization rule.", SerializedName = @"eventHubAuthorizationRuleId", PossibleTypes = new [] { typeof(string) })] @@ -114,6 +117,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -122,10 +128,13 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings) })] + System.Collections.Generic.List Log { get; set; } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, /// or use a destination type constructed as follows: _. Possible values @@ -134,6 +143,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)", SerializedName = @"logAnalyticsDestinationType", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +156,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", SerializedName = @"marketplacePartnerId", PossibleTypes = new [] { typeof(string) })] @@ -152,16 +167,22 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of metric settings.", SerializedName = @"metrics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings) })] + System.Collections.Generic.List Metric { get; set; } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", SerializedName = @"serviceBusRuleId", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +193,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -182,6 +206,9 @@ public partial interface IDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", SerializedName = @"workspaceId", PossibleTypes = new [] { typeof(string) })] @@ -199,7 +226,7 @@ internal partial interface IDiagnosticSettingsInternal /// string EventHubName { get; set; } /// The list of logs settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get; set; } + System.Collections.Generic.List Log { get; set; } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, /// or use a destination type constructed as follows: _. Possible values @@ -211,7 +238,7 @@ internal partial interface IDiagnosticSettingsInternal /// string MarketplacePartnerId { get; set; } /// The list of metric settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get; set; } + System.Collections.Generic.List Metric { get; set; } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.json.cs similarity index 87% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.json.cs index 4622a770a4f3..3c8549ab7deb 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettings.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,26 +65,26 @@ internal DiagnosticSettings(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Diagnosti { return; } - {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} - {_serviceBusRuleId = If( json?.PropertyT("serviceBusRuleId"), out var __jsonServiceBusRuleId) ? (string)__jsonServiceBusRuleId : (string)ServiceBusRuleId;} - {_eventHubAuthorizationRuleId = If( json?.PropertyT("eventHubAuthorizationRuleId"), out var __jsonEventHubAuthorizationRuleId) ? (string)__jsonEventHubAuthorizationRuleId : (string)EventHubAuthorizationRuleId;} - {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)EventHubName;} - {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? If( __jsonMetrics as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings.FromJson(__u) )) ))() : null : Metric;} - {_log = If( json?.PropertyT("logs"), out var __jsonLogs) ? If( __jsonLogs as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ILogSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.LogSettings.FromJson(__p) )) ))() : null : Log;} - {_workspaceId = If( json?.PropertyT("workspaceId"), out var __jsonWorkspaceId) ? (string)__jsonWorkspaceId : (string)WorkspaceId;} - {_marketplacePartnerId = If( json?.PropertyT("marketplacePartnerId"), out var __jsonMarketplacePartnerId) ? (string)__jsonMarketplacePartnerId : (string)MarketplacePartnerId;} - {_logAnalyticsDestinationType = If( json?.PropertyT("logAnalyticsDestinationType"), out var __jsonLogAnalyticsDestinationType) ? (string)__jsonLogAnalyticsDestinationType : (string)LogAnalyticsDestinationType;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)_storageAccountId;} + {_serviceBusRuleId = If( json?.PropertyT("serviceBusRuleId"), out var __jsonServiceBusRuleId) ? (string)__jsonServiceBusRuleId : (string)_serviceBusRuleId;} + {_eventHubAuthorizationRuleId = If( json?.PropertyT("eventHubAuthorizationRuleId"), out var __jsonEventHubAuthorizationRuleId) ? (string)__jsonEventHubAuthorizationRuleId : (string)_eventHubAuthorizationRuleId;} + {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)_eventHubName;} + {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? If( __jsonMetrics as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.IMetricSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettings.FromJson(__u) )) ))() : null : _metric;} + {_log = If( json?.PropertyT("logs"), out var __jsonLogs) ? If( __jsonLogs as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.ILogSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettings.FromJson(__p) )) ))() : null : _log;} + {_workspaceId = If( json?.PropertyT("workspaceId"), out var __jsonWorkspaceId) ? (string)__jsonWorkspaceId : (string)_workspaceId;} + {_marketplacePartnerId = If( json?.PropertyT("marketplacePartnerId"), out var __jsonMarketplacePartnerId) ? (string)__jsonMarketplacePartnerId : (string)_marketplacePartnerId;} + {_logAnalyticsDestinationType = If( json?.PropertyT("logAnalyticsDestinationType"), out var __jsonLogAnalyticsDestinationType) ? (string)__jsonLogAnalyticsDestinationType : (string)_logAnalyticsDestinationType;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettings(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.PowerShell.cs similarity index 74% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.PowerShell.cs index 35dffbc01f10..f3f96c0125ea 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,35 +63,35 @@ public partial class DiagnosticSettingsCategory 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DiagnosticSettingsCategory(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DiagnosticSettingsCategory(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 +106,17 @@ internal DiagnosticSettingsCategory(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("CategoryType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType?) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryType = (string) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryType, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryGroup = (string[]) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryGroup = (System.Collections.Generic.List) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,11 +131,11 @@ internal DiagnosticSettingsCategory(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("CategoryType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType?) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryType = (string) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryType, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryGroup = (string[]) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryGroup = (System.Collections.Generic.List) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -145,7 +145,7 @@ internal DiagnosticSettingsCategory(global::System.Management.Automation.PSObjec /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.TypeConverter.cs index 1727f9ec5edd..ccd82b60da47 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.cs similarity index 71% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.cs index cd1dadf88599..c875a77dc37e 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.cs @@ -3,29 +3,29 @@ // Code generated by 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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The diagnostic settings Category. public partial class DiagnosticSettingsCategory : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal { /// Backing field for property. - private string[] _categoryGroup; + private System.Collections.Generic.List _categoryGroup; /// the collection of what category groups are supported. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public string[] CategoryGroup { get => this._categoryGroup; set => this._categoryGroup = value; } + public System.Collections.Generic.List CategoryGroup { get => this._categoryGroup; set => this._categoryGroup = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? _categoryType; + private string _categoryType; /// The type of the diagnostic settings category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get => this._categoryType; set => this._categoryType = value; } + public string CategoryType { get => this._categoryType; set => this._categoryType = value; } /// Creates an new instance. public DiagnosticSettingsCategory() @@ -41,18 +41,25 @@ public partial interface IDiagnosticSettingsCategory : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the collection of what category groups are supported.", SerializedName = @"categoryGroups", PossibleTypes = new [] { typeof(string) })] - string[] CategoryGroup { get; set; } + System.Collections.Generic.List CategoryGroup { get; set; } /// The type of the diagnostic settings category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the diagnostic settings category.", SerializedName = @"categoryType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("Metrics", "Logs")] + string CategoryType { get; set; } } /// The diagnostic settings Category. @@ -60,9 +67,10 @@ internal partial interface IDiagnosticSettingsCategoryInternal { /// the collection of what category groups are supported. - string[] CategoryGroup { get; set; } + System.Collections.Generic.List CategoryGroup { get; set; } /// The type of the diagnostic settings category. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("Metrics", "Logs")] + string CategoryType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.json.cs similarity index 92% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.json.cs index a87f1788ddde..9a451404c657 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategory.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategory.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DiagnosticSettingsCategory(Microsoft.Azure.PowerShell.Cmdlets.Monitor.D { return; } - {_categoryType = If( json?.PropertyT("categoryType"), out var __jsonCategoryType) ? (string)__jsonCategoryType : (string)CategoryType;} - {_categoryGroup = If( json?.PropertyT("categoryGroups"), out var __jsonCategoryGroups) ? If( __jsonCategoryGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : CategoryGroup;} + {_categoryType = If( json?.PropertyT("categoryType"), out var __jsonCategoryType) ? (string)__jsonCategoryType : (string)_categoryType;} + {_categoryGroup = If( json?.PropertyT("categoryGroups"), out var __jsonCategoryGroups) ? If( __jsonCategoryGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _categoryGroup;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettingsCategory(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.PowerShell.cs new file mode 100644 index 000000000000..f691f0f517a8 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.PowerShell.cs @@ -0,0 +1,264 @@ +// 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.DiagnosticSetting.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + + /// The diagnostic settings category resource. + [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsCategoryResourceTypeConverter))] + public partial class DiagnosticSettingsCategoryResource + { + + /// + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiagnosticSettingsCategoryResource(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("CategoryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType = (string) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)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("CategoryGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup = (System.Collections.Generic.List) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiagnosticSettingsCategoryResource(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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("CategoryType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType = (string) content.GetValueForProperty("CategoryType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)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("CategoryGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup = (System.Collections.Generic.List) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).CategoryGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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 diagnostic settings category resource. + [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsCategoryResourceTypeConverter))] + public partial interface IDiagnosticSettingsCategoryResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.TypeConverter.cs index e16e737a620e..b58f8cdb3369 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.cs similarity index 51% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.cs index 9f6a0c18d45f..8e6e1fe3bd71 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.cs @@ -3,98 +3,126 @@ // Code generated by 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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The diagnostic settings category resource. public partial class DiagnosticSettingsCategoryResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(); /// the collection of what category groups are supported. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string[] CategoryGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)Property).CategoryGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)Property).CategoryGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CategoryGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryGroup; } /// The type of the diagnostic settings category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)Property).CategoryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryInternal)Property).CategoryType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType)""); } + public string CategoryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryType; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; } - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name = value; } + /// Internal Acessors for CategoryGroup + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.CategoryGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryGroup = value ?? null /* arrayOf */; } - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type = value; } + /// Internal Acessors for CategoryType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.CategoryType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryInternal)Property).CategoryType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategory()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategory()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory _property; /// The properties of a Diagnostic Settings Category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategory()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategory()); } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData _systemData; /// The system metadata related to this resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public DiagnosticSettingsCategoryResource() @@ -117,98 +145,128 @@ public DiagnosticSettingsCategoryResource() /// The diagnostic settings category resource. public partial interface IDiagnosticSettingsCategoryResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource { /// the collection of what category groups are supported. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"the collection of what category groups are supported.", SerializedName = @"categoryGroups", PossibleTypes = new [] { typeof(string) })] - string[] CategoryGroup { get; set; } + System.Collections.Generic.List CategoryGroup { get; } /// The type of the diagnostic settings category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the diagnostic settings category.", SerializedName = @"categoryType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("Metrics", "Logs")] + string CategoryType { get; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// The diagnostic settings category resource. internal partial interface IDiagnosticSettingsCategoryResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal { /// the collection of what category groups are supported. - string[] CategoryGroup { get; set; } + System.Collections.Generic.List CategoryGroup { get; set; } /// The type of the diagnostic settings category. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType? CategoryType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("Metrics", "Logs")] + string CategoryType { get; set; } /// The properties of a Diagnostic Settings Category. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategory Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategory Property { get; set; } /// The system metadata related to this resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.json.cs similarity index 91% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.json.cs index 3e9bb79a96e5..b7c26c0d1dc0 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResource.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,20 +65,20 @@ internal DiagnosticSettingsCategoryResource(Microsoft.Azure.PowerShell.Cmdlets.M { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategory.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategory.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettingsCategoryResource(json) : null; } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json return container; } __resource?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.PowerShell.cs similarity index 75% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.PowerShell.cs index 1347df9a4d44..e3a5f02448f3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,35 +63,35 @@ public partial class DiagnosticSettingsCategoryResourceCollection 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DiagnosticSettingsCategoryResourceCollection(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DiagnosticSettingsCategoryResourceCollection(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,13 +106,13 @@ internal DiagnosticSettingsCategoryResourceCollection(global::System.Collections // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResourceTypeConverter.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. @@ -127,7 +127,7 @@ internal DiagnosticSettingsCategoryResourceCollection(global::System.Management. // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -140,7 +140,7 @@ internal DiagnosticSettingsCategoryResourceCollection(global::System.Management. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.TypeConverter.cs index 8d904f588e0c..3e473a70a067 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.cs similarity index 69% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.cs index cc205accf9a9..221693867aca 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Represents a collection of diagnostic setting category resources. public partial class DiagnosticSettingsCategoryResourceCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollectionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[] _value; + private System.Collections.Generic.List _value; /// The collection of diagnostic settings category resources. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[] 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. @@ -36,10 +36,13 @@ public partial interface IDiagnosticSettingsCategoryResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The collection of diagnostic settings category resources.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource) })] + System.Collections.Generic.List Value { get; set; } } /// Represents a collection of diagnostic setting category resources. @@ -47,7 +50,7 @@ internal partial interface IDiagnosticSettingsCategoryResourceCollectionInternal { /// The collection of diagnostic settings category resources. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.json.cs similarity index 88% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.json.cs index aa25f86231a0..df7fa30ef2e1 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsCategoryResourceCollection.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsCategoryResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -66,18 +66,18 @@ internal DiagnosticSettingsCategoryResourceCollection(Microsoft.Azure.PowerShell { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsCategoryResource.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsCategoryResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettingsCategoryResourceCollection(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.PowerShell.cs new file mode 100644 index 000000000000..c59367bc1b2d --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.PowerShell.cs @@ -0,0 +1,318 @@ +// 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.DiagnosticSetting.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + + /// The diagnostic setting resource. + [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsResourceTypeConverter))] + public partial class DiagnosticSettingsResource + { + + /// + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DiagnosticSettingsResource(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.DiagnosticSetting.Models.IDiagnosticSettingsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DiagnosticSettingsResource(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DiagnosticSettingsResource(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.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)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("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("ServiceBusRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubAuthorizationRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Metric = (System.Collections.Generic.List) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Metric, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("WorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("MarketplacePartnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + } + if (content.Contains("LogAnalyticsDestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DiagnosticSettingsResource(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.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)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("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("ServiceBusRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubAuthorizationRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Metric = (System.Collections.Generic.List) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Metric, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.MetricSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LogSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("WorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("MarketplacePartnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + } + if (content.Contains("LogAnalyticsDestinationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType = (string) content.GetValueForProperty("LogAnalyticsDestinationType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).LogAnalyticsDestinationType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(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.DiagnosticSetting.Models.IDiagnosticSettingsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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 diagnostic setting resource. + [System.ComponentModel.TypeConverter(typeof(DiagnosticSettingsResourceTypeConverter))] + public partial interface IDiagnosticSettingsResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.TypeConverter.cs index 9d596cf038c6..222d0781ee1d 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.cs similarity index 62% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.cs index e682e1dd61ee..fff92888ac6b 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.cs @@ -3,41 +3,41 @@ // Code generated by 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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The diagnostic setting resource. public partial class DiagnosticSettingsResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(); /// The resource Id for the event hub authorization rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string EventHubAuthorizationRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId = value ?? null; } + public string EventHubAuthorizationRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId = value ?? null; } /// /// The name of the event hub. If none is specified, the default event hub will be selected. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string EventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).EventHubName = value ?? null; } + public string EventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).EventHubName = value ?? null; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; } /// The list of logs settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).Log; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).Log = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).Log; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).Log = value ?? null /* arrayOf */; } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, @@ -45,98 +45,120 @@ public partial class DiagnosticSettingsResource : /// are: Dedicated and null (null is default.) /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string LogAnalyticsDestinationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).LogAnalyticsDestinationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).LogAnalyticsDestinationType = value ?? null; } + public string LogAnalyticsDestinationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).LogAnalyticsDestinationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).LogAnalyticsDestinationType = value ?? null; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string MarketplacePartnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).MarketplacePartnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).MarketplacePartnerId = value ?? null; } + public string MarketplacePartnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).MarketplacePartnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).MarketplacePartnerId = value ?? null; } /// The list of metric settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).Metric = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).Metric = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettings()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettings()); set { {_property = value;} } } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); set { {_systemData = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings _property; /// Properties of a Diagnostic Settings Resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettings()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettings()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string ServiceBusRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).ServiceBusRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).ServiceBusRuleId = value ?? null; } + public string ServiceBusRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).ServiceBusRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).ServiceBusRuleId = value ?? null; } /// /// The resource ID of the storage account to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).StorageAccountId = value ?? null; } + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).StorageAccountId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData _systemData; /// The system metadata related to this resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string WorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).WorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsInternal)Property).WorkspaceId = value ?? null; } + public string WorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).WorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsInternal)Property).WorkspaceId = value ?? null; } /// Creates an new instance. public DiagnosticSettingsResource() @@ -159,12 +181,15 @@ public DiagnosticSettingsResource() /// The diagnostic setting resource. public partial interface IDiagnosticSettingsResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource { /// The resource Id for the event hub authorization rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id for the event hub authorization rule.", SerializedName = @"eventHubAuthorizationRuleId", PossibleTypes = new [] { typeof(string) })] @@ -175,6 +200,9 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -183,10 +211,13 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings) })] + System.Collections.Generic.List Log { get; set; } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, /// or use a destination type constructed as follows: _. Possible values @@ -195,6 +226,9 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)", SerializedName = @"logAnalyticsDestinationType", PossibleTypes = new [] { typeof(string) })] @@ -205,6 +239,9 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", SerializedName = @"marketplacePartnerId", PossibleTypes = new [] { typeof(string) })] @@ -213,16 +250,22 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of metric settings.", SerializedName = @"metrics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings) })] + System.Collections.Generic.List Metric { get; set; } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", SerializedName = @"serviceBusRuleId", PossibleTypes = new [] { typeof(string) })] @@ -233,6 +276,9 @@ public partial interface IDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -240,57 +286,80 @@ public partial interface IDiagnosticSettingsResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", SerializedName = @"workspaceId", PossibleTypes = new [] { typeof(string) })] @@ -299,7 +368,7 @@ public partial interface IDiagnosticSettingsResource : } /// The diagnostic setting resource. internal partial interface IDiagnosticSettingsResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal { /// The resource Id for the event hub authorization rule. string EventHubAuthorizationRuleId { get; set; } @@ -308,7 +377,7 @@ internal partial interface IDiagnosticSettingsResourceInternal : /// string EventHubName { get; set; } /// The list of logs settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get; set; } + System.Collections.Generic.List Log { get; set; } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, /// or use a destination type constructed as follows: _. Possible values @@ -320,9 +389,9 @@ internal partial interface IDiagnosticSettingsResourceInternal : /// string MarketplacePartnerId { get; set; } /// The list of metric settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get; set; } + System.Collections.Generic.List Metric { get; set; } /// Properties of a Diagnostic Settings Resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettings Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettings Property { get; set; } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// @@ -332,19 +401,21 @@ internal partial interface IDiagnosticSettingsResourceInternal : /// string StorageAccountId { get; set; } /// The system metadata related to this resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.json.cs similarity index 92% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.json.cs index f6865cf50e45..c0c82e9ed642 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResource.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,20 +65,20 @@ internal DiagnosticSettingsResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.D { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettings.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettings.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettingsResource(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json } __resource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.PowerShell.cs similarity index 75% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.PowerShell.cs index c722b1f5e94e..2059108599e8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,35 +63,35 @@ public partial class DiagnosticSettingsResourceCollection 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DiagnosticSettingsResourceCollection(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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DiagnosticSettingsResourceCollection(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,13 +106,13 @@ internal DiagnosticSettingsResourceCollection(global::System.Collections.IDictio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResourceTypeConverter.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. @@ -127,7 +127,7 @@ internal DiagnosticSettingsResourceCollection(global::System.Management.Automati // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -139,7 +139,7 @@ internal DiagnosticSettingsResourceCollection(global::System.Management.Automati /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.TypeConverter.cs index 8575a0f64dca..274e2e610843 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.cs similarity index 69% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.cs index ef8cfbe80bf3..e630256315d3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Represents a collection of alert rule resources. public partial class DiagnosticSettingsResourceCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollectionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[] _value; + private System.Collections.Generic.List _value; /// The collection of diagnostic settings resources;. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[] 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 DiagnosticSettingsResourceCollection() @@ -34,10 +34,13 @@ public partial interface IDiagnosticSettingsResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The collection of diagnostic settings resources;.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource) })] + System.Collections.Generic.List Value { get; set; } } /// Represents a collection of alert rule resources. @@ -45,7 +48,7 @@ internal partial interface IDiagnosticSettingsResourceCollectionInternal { /// The collection of diagnostic settings resources;. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.json.cs similarity index 89% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.json.cs index c1e3cfc6d04d..ce55267cda4c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/DiagnosticSettingsResourceCollection.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/DiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,18 +65,18 @@ internal DiagnosticSettingsResourceCollection(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new DiagnosticSettingsResourceCollection(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 79% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 43a3b538fdb5..b16688954d2c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,35 +63,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.DiagnosticSetting.Models.Api20150401.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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. @@ -106,17 +104,17 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -131,11 +129,11 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +143,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.DiagnosticSetting.Models.Api20150401.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index d90078113d25..b4a919e8abc3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.cs similarity index 93% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.cs index 71c75d7b99af..0e32eaddaa9c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Describes the format of Error response. public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponseInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error code", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/ErrorResponse.json.cs index 183afcf5d872..f8983d06bf42 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/ErrorResponse.json.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSett { 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;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.PowerShell.cs similarity index 78% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.PowerShell.cs index d421d9aaa85d..c14dbc21716d 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -66,35 +66,35 @@ public partial class EventCategoryCollection 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.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EventCategoryCollection(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.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EventCategoryCollection(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -109,13 +109,13 @@ internal EventCategoryCollection(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.LocalizableStringTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LocalizableStringTypeConverter.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. @@ -130,7 +130,7 @@ internal EventCategoryCollection(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.LocalizableStringTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LocalizableStringTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -140,7 +140,7 @@ internal EventCategoryCollection(global::System.Management.Automation.PSObject c /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.TypeConverter.cs index 725efc12d024..d52dbee939a1 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.cs similarity index 73% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.cs index d743ef015c15..42faf779aef7 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -12,16 +12,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Ap /// Policy. /// public partial class EventCategoryCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollectionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[] _value; + private System.Collections.Generic.List _value; /// the list that includes the Azure event categories. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[] 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 EventCategoryCollection() @@ -38,10 +38,13 @@ public partial interface IEventCategoryCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the list that includes the Azure event categories.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString) })] + System.Collections.Generic.List Value { get; set; } } /// A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, @@ -50,7 +53,7 @@ internal partial interface IEventCategoryCollectionInternal { /// the list that includes the Azure event categories. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.json.cs similarity index 90% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.json.cs index 27f3040a4cc0..da26d4bd7e99 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/EventCategoryCollection.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/EventCategoryCollection.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -68,18 +68,18 @@ internal EventCategoryCollection(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Diag { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.ILocalizableString) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.LocalizableString.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.ILocalizableString) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.LocalizableString.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new EventCategoryCollection(json) : null; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.PowerShell.cs similarity index 79% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.PowerShell.cs index 90db43851a91..be8f7ad3eb68 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class LocalizableString 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.DiagnosticSetting.Models.Api20150401.ILocalizableString DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LocalizableString(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.DiagnosticSetting.Models.Api20150401.ILocalizableString DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LocalizableString(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 LocalizableString(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("LocalizedValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).LocalizedValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).LocalizedValue, 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 LocalizableString(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("LocalizedValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal)this).LocalizedValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal)this).LocalizedValue, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.TypeConverter.cs index 982007e01580..2448aac0cc36 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.ILocalizableString ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.cs similarity index 93% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.cs index 4bb262edfd97..cb4b04d29b30 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The localizable string class. public partial class LocalizableString : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableStringInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableStringInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ILocalizableString : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the locale specific value.", SerializedName = @"localizedValue", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ILocalizableString : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the invariant value.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.json.cs index 3e76ef4dea3b..22b80eb9ce33 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20150401/LocalizableString.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LocalizableString.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.DiagnosticSetting.Models.Api20150401 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LocalizableString partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new LocalizableString(json) : null; } @@ -77,8 +77,8 @@ internal LocalizableString(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Diagnostic { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} - {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)LocalizedValue;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} + {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)_localizedValue;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.PowerShell.cs similarity index 64% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.PowerShell.cs index 295aca9960ed..20f5ab54164e 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class LogSettings 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.DiagnosticSetting.Models.Api20210501Preview.ILogSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LogSettings(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.DiagnosticSetting.Models.Api20210501Preview.ILogSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LogSettings(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,33 +113,33 @@ internal LogSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RetentionPolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicyTypeConverter.ConvertFrom); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RetentionPolicyDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyDay = (int) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyDay = (int?) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("RetentionPolicyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyEnabled = (bool) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyEnabled = (bool?) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,27 +154,27 @@ internal LogSettings(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("RetentionPolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicyTypeConverter.ConvertFrom); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RetentionPolicyDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyDay = (int) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyDay = (int?) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("RetentionPolicyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyEnabled = (bool) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyEnabled = (bool?) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.TypeConverter.cs index 3e9ee558b97a..7b219ebd5281 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ILogSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.cs similarity index 84% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.cs index 77bb8fe52987..9f8547da5f17 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Ap /// Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. /// public partial class LogSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal { /// Backing field for property. @@ -43,24 +43,24 @@ public partial class LogSettings : public bool Enabled { get => this._enabled; set => this._enabled = value; } /// Internal Acessors for RetentionPolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettingsInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy()); set { {_retentionPolicy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettingsInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy()); set { {_retentionPolicy = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy _retentionPolicy; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy _retentionPolicy; /// the retention policy for this log. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy()); set => this._retentionPolicy = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy()); set => this._retentionPolicy = value; } /// /// the number of days for the retention in days. A value of 0 will retain the events indefinitely. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public int? RetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Day = value ?? default(int); } + public int? RetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Day = value ?? default(int); } /// a value indicating whether the retention policy is enabled. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public bool? RetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Enabled = value ?? default(bool); } + public bool? RetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Enabled = value ?? default(bool); } /// Creates an new instance. public LogSettings() @@ -79,6 +79,9 @@ public partial interface ILogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +93,9 @@ public partial interface ILogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.", SerializedName = @"categoryGroup", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +104,9 @@ public partial interface ILogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether this log is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -108,6 +117,9 @@ public partial interface ILogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the number of days for the retention in days. A value of 0 will retain the events indefinitely.", SerializedName = @"days", PossibleTypes = new [] { typeof(int) })] @@ -116,6 +128,9 @@ public partial interface ILogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether the retention policy is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -139,7 +154,7 @@ internal partial interface ILogSettingsInternal /// a value indicating whether this log is enabled. bool Enabled { get; set; } /// the retention policy for this log. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy RetentionPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy RetentionPolicy { get; set; } /// /// the number of days for the retention in days. A value of 0 will retain the events indefinitely. /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.json.cs index cda02d74d438..1f1ae4e76a85 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/LogSettings.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/LogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class LogSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new LogSettings(json) : null; } @@ -79,10 +79,10 @@ internal LogSettings(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSettin { return; } - {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_categoryGroup = If( json?.PropertyT("categoryGroup"), out var __jsonCategoryGroup) ? (string)__jsonCategoryGroup : (string)CategoryGroup;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy.FromJson(__jsonRetentionPolicy) : _retentionPolicy;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_categoryGroup = If( json?.PropertyT("categoryGroup"), out var __jsonCategoryGroup) ? (string)__jsonCategoryGroup : (string)_categoryGroup;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : _enabled;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.PowerShell.cs similarity index 64% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.PowerShell.cs index 2542418e0d49..bd80a147f56c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class MetricSettings 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.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MetricSettings(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.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricSettings(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,33 +113,33 @@ internal MetricSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RetentionPolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicyTypeConverter.ConvertFrom); } if (content.Contains("TimeGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).TimeGrain = (global::System.TimeSpan?) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).TimeGrain = (global::System.TimeSpan?) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RetentionPolicyDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyDay = (int) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyDay = (int?) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("RetentionPolicyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyEnabled = (bool) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyEnabled = (bool?) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,27 +154,27 @@ internal MetricSettings(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("RetentionPolicy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy) content.GetValueForProperty("RetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicyTypeConverter.ConvertFrom); } if (content.Contains("TimeGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).TimeGrain = (global::System.TimeSpan?) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).TimeGrain = (global::System.TimeSpan?) content.GetValueForProperty("TimeGrain",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).TimeGrain, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RetentionPolicyDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyDay = (int) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyDay = (int?) content.GetValueForProperty("RetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("RetentionPolicyEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyEnabled = (bool) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyEnabled = (bool?) content.GetValueForProperty("RetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal)this).RetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.TypeConverter.cs index 7499830f9805..28232ec3b337 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.cs similarity index 84% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.cs index 76b8ede2ad6a..17a8738db13f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Ap /// Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. /// public partial class MetricSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal { /// Backing field for property. @@ -33,24 +33,24 @@ public partial class MetricSettings : public bool Enabled { get => this._enabled; set => this._enabled = value; } /// Internal Acessors for RetentionPolicy - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettingsInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy()); set { {_retentionPolicy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettingsInternal.RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy()); set { {_retentionPolicy = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy _retentionPolicy; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy _retentionPolicy; /// the retention policy for this category. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy()); set => this._retentionPolicy = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy RetentionPolicy { get => (this._retentionPolicy = this._retentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy()); set => this._retentionPolicy = value; } /// /// the number of days for the retention in days. A value of 0 will retain the events indefinitely. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public int? RetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Day = value ?? default(int); } + public int? RetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Day = value ?? default(int); } /// a value indicating whether the retention policy is enabled. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public bool? RetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)RetentionPolicy).Enabled = value ?? default(bool); } + public bool? RetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)RetentionPolicy).Enabled = value ?? default(bool); } /// Backing field for property. private global::System.TimeSpan? _timeGrain; @@ -76,6 +76,9 @@ public partial interface IMetricSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +87,9 @@ public partial interface IMetricSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether this category is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +100,9 @@ public partial interface IMetricSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the number of days for the retention in days. A value of 0 will retain the events indefinitely.", SerializedName = @"days", PossibleTypes = new [] { typeof(int) })] @@ -102,6 +111,9 @@ public partial interface IMetricSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether the retention policy is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -110,6 +122,9 @@ public partial interface IMetricSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the timegrain of the metric in ISO8601 format.", SerializedName = @"timeGrain", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -128,7 +143,7 @@ internal partial interface IMetricSettingsInternal /// a value indicating whether this category is enabled. bool Enabled { get; set; } /// the retention policy for this category. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy RetentionPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy RetentionPolicy { get; set; } /// /// the number of days for the retention in days. A value of 0 will retain the events indefinitely. /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.json.cs similarity index 93% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.json.cs index b451abba780b..f7a67a689c20 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/MetricSettings.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/MetricSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class MetricSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new MetricSettings(json) : null; } @@ -79,10 +79,10 @@ internal MetricSettings(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSet { return; } - {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.RetentionPolicy.FromJson(__jsonRetentionPolicy) : RetentionPolicy;} - {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeGrain ) : TimeGrain;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_retentionPolicy = If( json?.PropertyT("retentionPolicy"), out var __jsonRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.RetentionPolicy.FromJson(__jsonRetentionPolicy) : _retentionPolicy;} + {_timeGrain = If( json?.PropertyT("timeGrain"), out var __jsonTimeGrain) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonTimeGrain ) : _timeGrain;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : _enabled;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 78% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.PowerShell.cs index a0697c1b5e3e..0ced6d4547d6 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,21 +113,21 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)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. @@ -142,15 +142,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.TypeConverter.cs index 13eaecef6312..e438f3e2060c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.cs similarity index 90% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.cs index cd579c652cb7..5ed208103283 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Ap /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal { /// Backing field for property. @@ -25,13 +25,13 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -65,6 +65,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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) })] @@ -73,6 +76,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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) })] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Resource.json.cs index 3d6938118930..ddecf3c77135 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/Resource.json.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,9 +79,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.R { return; } - {_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;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.PowerShell.cs similarity index 77% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.PowerShell.cs index 85fdbb5b4d74..194c149c3af4 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class RetentionPolicy 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.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RetentionPolicy(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.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RetentionPolicy(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 RetentionPolicy(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Day")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Day = (int) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Day = (int) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } 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 RetentionPolicy(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Day")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Day = (int) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Day = (int) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.TypeConverter.cs index a2d8695859e8..912e5c1dd684 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.cs index 0f31cb35f0b0..b3ced6974181 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Specifies the retention policy for the log. public partial class RetentionPolicy : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicyInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface IRetentionPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the number of days for the retention in days. A value of 0 will retain the events indefinitely.", SerializedName = @"days", PossibleTypes = new [] { typeof(int) })] @@ -53,6 +56,9 @@ public partial interface IRetentionPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether the retention policy is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.json.cs index 101ee568c780..b68bd7ba94d3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/RetentionPolicy.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/RetentionPolicy.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RetentionPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new RetentionPolicy(json) : null; } @@ -77,8 +77,8 @@ internal RetentionPolicy(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSe { return; } - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} - {_day = If( json?.PropertyT("days"), out var __jsonDays) ? (int)__jsonDays : Day;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : _enabled;} + {_day = If( json?.PropertyT("days"), out var __jsonDays) ? (int)__jsonDays : _day;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.PowerShell.cs similarity index 59% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.PowerShell.cs index 79aa93d658f2..5b07e6c34688 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class SubscriptionDiagnosticSettings 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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SubscriptionDiagnosticSettings(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SubscriptionDiagnosticSettings(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,37 +113,37 @@ internal SubscriptionDiagnosticSettings(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("StorageAccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); } if (content.Contains("ServiceBusRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubAuthorizationRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("Log")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettingsTypeConverter.ConvertFrom)); } if (content.Contains("WorkspaceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); } if (content.Contains("MarketplacePartnerId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId, 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. @@ -158,31 +158,31 @@ internal SubscriptionDiagnosticSettings(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("StorageAccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).StorageAccountId, global::System.Convert.ToString); } if (content.Contains("ServiceBusRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).ServiceBusRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubAuthorizationRuleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); } if (content.Contains("EventHubName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).EventHubName, global::System.Convert.ToString); } if (content.Contains("Log")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[]) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettingsTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettingsTypeConverter.ConvertFrom)); } if (content.Contains("WorkspaceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).WorkspaceId, global::System.Convert.ToString); } if (content.Contains("MarketplacePartnerId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)this).MarketplacePartnerId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.TypeConverter.cs index 5f97f275d015..799d3e79e168 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.cs similarity index 88% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.cs index 7cfe01af0234..285564802b65 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The subscription diagnostic settings. public partial class SubscriptionDiagnosticSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal { /// Backing field for property. @@ -30,11 +30,11 @@ public partial class SubscriptionDiagnosticSettings : public string EventHubName { get => this._eventHubName; set => this._eventHubName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] _log; + private System.Collections.Generic.List _log; /// The list of logs settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get => this._log; set => this._log = value; } + public System.Collections.Generic.List Log { get => this._log; set => this._log = value; } /// Backing field for property. private string _marketplacePartnerId; @@ -86,6 +86,9 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id for the event hub authorization rule.", SerializedName = @"eventHubAuthorizationRuleId", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +99,9 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -104,16 +110,22 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings) })] + System.Collections.Generic.List Log { get; set; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", SerializedName = @"marketplacePartnerId", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +136,9 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", SerializedName = @"serviceBusRuleId", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +149,9 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +162,9 @@ public partial interface ISubscriptionDiagnosticSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", SerializedName = @"workspaceId", PossibleTypes = new [] { typeof(string) })] @@ -161,7 +182,7 @@ internal partial interface ISubscriptionDiagnosticSettingsInternal /// string EventHubName { get; set; } /// The list of logs settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get; set; } + System.Collections.Generic.List Log { get; set; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.json.cs similarity index 89% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.json.cs index 40862b3231cd..eb083a9d1661 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettings.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SubscriptionDiagnosticSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new SubscriptionDiagnosticSettings(json) : null; } @@ -77,13 +77,13 @@ internal SubscriptionDiagnosticSettings(Microsoft.Azure.PowerShell.Cmdlets.Monit { return; } - {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} - {_serviceBusRuleId = If( json?.PropertyT("serviceBusRuleId"), out var __jsonServiceBusRuleId) ? (string)__jsonServiceBusRuleId : (string)ServiceBusRuleId;} - {_eventHubAuthorizationRuleId = If( json?.PropertyT("eventHubAuthorizationRuleId"), out var __jsonEventHubAuthorizationRuleId) ? (string)__jsonEventHubAuthorizationRuleId : (string)EventHubAuthorizationRuleId;} - {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)EventHubName;} - {_log = If( json?.PropertyT("logs"), out var __jsonLogs) ? If( __jsonLogs as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionLogSettings.FromJson(__u) )) ))() : null : Log;} - {_workspaceId = If( json?.PropertyT("workspaceId"), out var __jsonWorkspaceId) ? (string)__jsonWorkspaceId : (string)WorkspaceId;} - {_marketplacePartnerId = If( json?.PropertyT("marketplacePartnerId"), out var __jsonMarketplacePartnerId) ? (string)__jsonMarketplacePartnerId : (string)MarketplacePartnerId;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)_storageAccountId;} + {_serviceBusRuleId = If( json?.PropertyT("serviceBusRuleId"), out var __jsonServiceBusRuleId) ? (string)__jsonServiceBusRuleId : (string)_serviceBusRuleId;} + {_eventHubAuthorizationRuleId = If( json?.PropertyT("eventHubAuthorizationRuleId"), out var __jsonEventHubAuthorizationRuleId) ? (string)__jsonEventHubAuthorizationRuleId : (string)_eventHubAuthorizationRuleId;} + {_eventHubName = If( json?.PropertyT("eventHubName"), out var __jsonEventHubName) ? (string)__jsonEventHubName : (string)_eventHubName;} + {_log = If( json?.PropertyT("logs"), out var __jsonLogs) ? If( __jsonLogs as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionLogSettings) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettings.FromJson(__u) )) ))() : null : _log;} + {_workspaceId = If( json?.PropertyT("workspaceId"), out var __jsonWorkspaceId) ? (string)__jsonWorkspaceId : (string)_workspaceId;} + {_marketplacePartnerId = If( json?.PropertyT("marketplacePartnerId"), out var __jsonMarketplacePartnerId) ? (string)__jsonMarketplacePartnerId : (string)_marketplacePartnerId;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.PowerShell.cs new file mode 100644 index 000000000000..b0aebbb10bcf --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.PowerShell.cs @@ -0,0 +1,305 @@ +// 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.DiagnosticSetting.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + + /// The subscription diagnostic setting resource. + [System.ComponentModel.TypeConverter(typeof(SubscriptionDiagnosticSettingsResourceTypeConverter))] + public partial class SubscriptionDiagnosticSettingsResource + { + + /// + /// 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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)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("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("ServiceBusRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubAuthorizationRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("WorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("MarketplacePartnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SubscriptionDiagnosticSettingsResource(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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)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("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("ServiceBusRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId = (string) content.GetValueForProperty("ServiceBusRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).ServiceBusRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubAuthorizationRuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId = (string) content.GetValueForProperty("EventHubAuthorizationRuleId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubAuthorizationRuleId, global::System.Convert.ToString); + } + if (content.Contains("EventHubName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName = (string) content.GetValueForProperty("EventHubName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).EventHubName, global::System.Convert.ToString); + } + if (content.Contains("Log")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Log = (System.Collections.Generic.List) content.GetValueForProperty("Log",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).Log, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionLogSettingsTypeConverter.ConvertFrom)); + } + if (content.Contains("WorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId = (string) content.GetValueForProperty("WorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).WorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("MarketplacePartnerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId = (string) content.GetValueForProperty("MarketplacePartnerId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).MarketplacePartnerId, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + 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.DiagnosticSetting.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 subscription diagnostic setting resource. + [System.ComponentModel.TypeConverter(typeof(SubscriptionDiagnosticSettingsResourceTypeConverter))] + public partial interface ISubscriptionDiagnosticSettingsResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.TypeConverter.cs index fdf4bc9b121e..98367bfbd9fe 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.cs similarity index 60% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.cs index 2de762382289..0c62b30a523c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.cs @@ -3,128 +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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// The subscription diagnostic setting resource. public partial class SubscriptionDiagnosticSettingsResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(); /// The resource Id for the event hub authorization rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string EventHubAuthorizationRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId = value ?? null; } + public string EventHubAuthorizationRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).EventHubAuthorizationRuleId = value ?? null; } /// /// The name of the event hub. If none is specified, the default event hub will be selected. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string EventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).EventHubName = value ?? null; } + public string EventHubName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).EventHubName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).EventHubName = value ?? null; } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; } /// The list of logs settings. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).Log; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).Log = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Log { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).Log; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).Log = value ?? null /* arrayOf */; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string MarketplacePartnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).MarketplacePartnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).MarketplacePartnerId = value ?? null; } + public string MarketplacePartnerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).MarketplacePartnerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).MarketplacePartnerId = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettings()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettings()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings _property; /// Properties of a Subscription Diagnostic Settings Resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettings()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettings()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string ServiceBusRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).ServiceBusRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).ServiceBusRuleId = value ?? null; } + public string ServiceBusRuleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).ServiceBusRuleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).ServiceBusRuleId = value ?? null; } /// /// The resource ID of the storage account to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).StorageAccountId = value ?? null; } + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).StorageAccountId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData _systemData; /// The system metadata related to this resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal)__resource).Type; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Inlined)] - public string WorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).WorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsInternal)Property).WorkspaceId = value ?? null; } + public string WorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).WorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsInternal)Property).WorkspaceId = value ?? null; } /// Creates an new instance. public SubscriptionDiagnosticSettingsResource() @@ -147,12 +169,15 @@ public SubscriptionDiagnosticSettingsResource() /// The subscription diagnostic setting resource. public partial interface ISubscriptionDiagnosticSettingsResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResource { /// The resource Id for the event hub authorization rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource Id for the event hub authorization rule.", SerializedName = @"eventHubAuthorizationRuleId", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +188,9 @@ public partial interface ISubscriptionDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", SerializedName = @"eventHubName", PossibleTypes = new [] { typeof(string) })] @@ -171,16 +199,22 @@ public partial interface ISubscriptionDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings) })] + System.Collections.Generic.List Log { get; set; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", SerializedName = @"marketplacePartnerId", PossibleTypes = new [] { typeof(string) })] @@ -191,6 +225,9 @@ public partial interface ISubscriptionDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", SerializedName = @"serviceBusRuleId", PossibleTypes = new [] { typeof(string) })] @@ -201,6 +238,9 @@ public partial interface ISubscriptionDiagnosticSettingsResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -208,57 +248,80 @@ public partial interface ISubscriptionDiagnosticSettingsResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", SerializedName = @"workspaceId", PossibleTypes = new [] { typeof(string) })] @@ -267,7 +330,7 @@ public partial interface ISubscriptionDiagnosticSettingsResource : } /// The subscription diagnostic setting resource. internal partial interface ISubscriptionDiagnosticSettingsResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IResourceInternal { /// The resource Id for the event hub authorization rule. string EventHubAuthorizationRuleId { get; set; } @@ -276,13 +339,13 @@ internal partial interface ISubscriptionDiagnosticSettingsResourceInternal : /// string EventHubName { get; set; } /// The list of logs settings. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get; set; } + System.Collections.Generic.List Log { get; set; } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. /// string MarketplacePartnerId { get; set; } /// Properties of a Subscription Diagnostic Settings Resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettings Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettings Property { get; set; } /// /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. /// @@ -292,19 +355,21 @@ internal partial interface ISubscriptionDiagnosticSettingsResourceInternal : /// string StorageAccountId { get; set; } /// The system metadata related to this resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 /// diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.json.cs similarity index 91% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.json.cs index f26ad10ee18b..3a9993426af8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResource.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResource.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SubscriptionDiagnosticSettingsResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new SubscriptionDiagnosticSettingsResource(json) : null; } @@ -77,9 +77,9 @@ internal SubscriptionDiagnosticSettingsResource(Microsoft.Azure.PowerShell.Cmdle { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettings.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettings.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json } __resource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.PowerShell.cs similarity index 74% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.PowerShell.cs index 240ed5cd5c50..ea13f3a3f7c6 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class SubscriptionDiagnosticSettingsResourceCollection 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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SubscriptionDiagnosticSettingsResourceCollection(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SubscriptionDiagnosticSettingsResourceCollection(content); } @@ -98,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,13 +116,13 @@ internal SubscriptionDiagnosticSettingsResourceCollection(global::System.Collect // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResourceTypeConverter.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. @@ -137,7 +137,7 @@ internal SubscriptionDiagnosticSettingsResourceCollection(global::System.Managem // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResourceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.TypeConverter.cs index 93f417709fb4..55c7f69afb77 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -112,14 +112,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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.cs similarity index 69% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.cs index 29be83a7486e..85ddf64f5ae2 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Represents a collection of subscription diagnostic settings resources. public partial class SubscriptionDiagnosticSettingsResourceCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollectionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[] _value; + private System.Collections.Generic.List _value; /// The collection of subscription diagnostic settings resources. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[] 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. @@ -36,10 +36,13 @@ public partial interface ISubscriptionDiagnosticSettingsResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The collection of subscription diagnostic settings resources.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource) })] + System.Collections.Generic.List Value { get; set; } } /// Represents a collection of subscription diagnostic settings resources. @@ -47,7 +50,7 @@ internal partial interface ISubscriptionDiagnosticSettingsResourceCollectionInte { /// The collection of subscription diagnostic settings resources. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.json.cs similarity index 88% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.json.cs index 08e711959dcd..90e8ccf40fb8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionDiagnosticSettingsResourceCollection.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionDiagnosticSettingsResourceCollection.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SubscriptionDiagnosticSettingsResourceCollection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new SubscriptionDiagnosticSettingsResourceCollection(json) : null; } @@ -78,7 +78,7 @@ internal SubscriptionDiagnosticSettingsResourceCollection(Microsoft.Azure.PowerS { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.PowerShell.cs similarity index 74% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.PowerShell.cs index c45a54c16d56..4b1a1b29b0e8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class SubscriptionLogSettings 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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SubscriptionLogSettings(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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SubscriptionLogSettings(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,21 +115,21 @@ internal SubscriptionLogSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,15 +144,15 @@ internal SubscriptionLogSettings(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("CategoryGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).CategoryGroup = (string) content.GetValueForProperty("CategoryGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).CategoryGroup, global::System.Convert.ToString); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.TypeConverter.cs similarity index 96% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.TypeConverter.cs index ec29b66f6889..05af698cd8c6 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.cs index 56173a6b90b3..da41a892a86d 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Ap /// Part of Subscription diagnostic setting. Specifies the settings for a particular log. /// public partial class SubscriptionLogSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettingsInternal { /// Backing field for property. @@ -56,6 +56,9 @@ public partial interface ISubscriptionLogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of a Subscription Diagnostic Log category for a resource type this setting is applied to.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface ISubscriptionLogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of a Subscription Diagnostic Log category group for a resource type this setting is applied to.", SerializedName = @"categoryGroup", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +80,9 @@ public partial interface ISubscriptionLogSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"a value indicating whether this log is enabled.", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.json.cs index 6b8dee8927ae..e446b85b994c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20210501Preview/SubscriptionLogSettings.json.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SubscriptionLogSettings.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.DiagnosticSetting.Models.Api20210501Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class SubscriptionLogSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new SubscriptionLogSettings(json) : null; } @@ -79,9 +79,9 @@ internal SubscriptionLogSettings(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Diag { return; } - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_categoryGroup = If( json?.PropertyT("categoryGroup"), out var __jsonCategoryGroup) ? (string)__jsonCategoryGroup : (string)CategoryGroup;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_categoryGroup = If( json?.PropertyT("categoryGroup"), out var __jsonCategoryGroup) ? (string)__jsonCategoryGroup : (string)_categoryGroup;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : _enabled;} AfterFromJson(json); } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 64% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.PowerShell.cs index 57f836b87f5d..64fdd8feac48 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Model /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 27259482b6dc..f3fb8c176f21 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.cs index 1a6e0191caf5..63cd54d361dd 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.json.cs similarity index 94% rename from generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/SystemData.json.cs index 9430ff2462d2..1a0b58af3b0f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting { 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/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.Completer.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.Completer.cs deleted file mode 100644 index 3e8a12e5093c..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.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.DiagnosticSetting.Support -{ - - /// The type of the diagnostic settings category. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryTypeTypeConverter))] - public partial struct CategoryType : - 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) || "Metrics".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Metrics'", "Metrics", global::System.Management.Automation.CompletionResultType.ParameterValue, "Metrics"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Logs".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Logs'", "Logs", global::System.Management.Automation.CompletionResultType.ParameterValue, "Logs"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.TypeConverter.cs deleted file mode 100644 index a1a6d84d4d6c..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.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.DiagnosticSetting.Support -{ - - /// The type of the diagnostic settings category. - public partial class CategoryTypeTypeConverter : - 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) => CategoryType.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/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.cs deleted file mode 100644 index 2c95d83405d4..000000000000 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CategoryType.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.DiagnosticSetting.Support -{ - - /// The type of the diagnostic settings category. - public partial struct CategoryType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType Logs = @"Logs"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType Metrics = @"Metrics"; - - /// 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 CategoryType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CategoryType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CategoryType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CategoryType - /// 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.DiagnosticSetting.Support.CategoryType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CategoryType (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 CategoryType && Equals((CategoryType)obj); - } - - /// Returns hashCode for enum CategoryType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CategoryType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CategoryType - /// the value to convert to an instance of . - - public static implicit operator CategoryType(string value) - { - return new CategoryType(value); - } - - /// Implicit operator to convert CategoryType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType e) - { - return e._value; - } - - /// Overriding != operator for enum CategoryType - /// 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.DiagnosticSetting.Support.CategoryType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CategoryType - /// 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.DiagnosticSetting.Support.CategoryType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CategoryType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index f520fdac4579..000000000000 --- a/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 04dc343397ca..000000000000 --- a/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index b4cdee57a864..000000000000 --- a/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_Get.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_Get.cs index bcb458e3cf93..61490ae09f73 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_Get.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the diagnostic settings category for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSettingCategory_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"CategoryGroup"}, NewOutputProperties=new string[] {"CategoryGroup"}, ChangeDescription="The type of the property CategoryGroup will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"CategoryGroup"}, NewOutputProperties = new string[] {"CategoryGroup" } , ChangeDescription = "The type of the property CategoryGroup will be changed from fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the diagnostic settings category for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSettingCategory_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_Get : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSettingCategory_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzDiagnosticSettingCategory_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzDiagnosticSettingCategory_Get : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource /// 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) @@ -170,6 +191,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDiagnosticSettingCategory_Get() { @@ -242,8 +268,33 @@ public GetAzDiagnosticSettingCategory_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) { 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId, 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 } }); @@ -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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource /// 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_GetViaIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_GetViaIdentity.cs index 3f74e9ca0abf..37320d2fe3b9 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_GetViaIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the diagnostic settings category for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSettingCategory_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"CategoryGroup"}, NewOutputProperties=new string[] {"CategoryGroup"}, ChangeDescription="The type of the property CategoryGroup will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"CategoryGroup"}, NewOutputProperties = new string[] {"CategoryGroup" } , ChangeDescription = "The type of the property CategoryGroup will be changed from fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the diagnostic settings category for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSettingCategory_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_GetViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSettingCategory_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_GetViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_GetViaIdentity : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource /// 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.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzDiagnosticSettingCategory_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } }); @@ -348,12 +399,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -370,7 +421,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -388,12 +439,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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource /// 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 ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_List.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_List.cs index 07a283876a62..e3e65750ed87 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_List.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSettingCategory_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Lists the diagnostic settings categories for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] List=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSettingCategory_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"CategoryGroup"}, NewOutputProperties=new string[] {"CategoryGroup"}, ChangeDescription="The type of the property CategoryGroup will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"CategoryGroup"}, NewOutputProperties = new string[] {"CategoryGroup" } , ChangeDescription = "The type of the property CategoryGroup will be changed from fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Lists the diagnostic settings categories for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettingsCategories", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSettingCategory_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSettingCategory_List : global::System.Manage /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSettingCategory_List : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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] @@ -79,7 +100,7 @@ public partial class GetAzDiagnosticSettingCategory_List : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,24 +137,24 @@ public partial class GetAzDiagnosticSettingCategory_List : global::System.Manage /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection /// 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) @@ -156,6 +177,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -177,7 +203,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDiagnosticSettingCategory_List() { @@ -228,8 +254,33 @@ public GetAzDiagnosticSettingCategory_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -282,7 +333,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -300,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -338,12 +389,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -360,15 +411,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId }) + 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 } }); @@ -378,12 +429,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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsCategoryResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection /// 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 ) { @@ -395,9 +446,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsCategoryResourceCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).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; + } + } } } } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_Get.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_Get.cs index 4a8bbcdc3590..a5d24a6ef2e7 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_Get.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the active diagnostic settings for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSetting_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log","Metric"}, NewOutputProperties=new string[] {"Log","Metric"}, ChangeDescription="The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSetting_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSetting_Get : 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 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSetting_Get : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzDiagnosticSetting_Get : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzDiagnosticSetting_Get : 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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) @@ -170,6 +191,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDiagnosticSetting_Get() { @@ -242,8 +268,33 @@ public GetAzDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) { 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId, 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 } }); @@ -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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_GetViaIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_GetViaIdentity.cs index 72ad49937b8f..84fc97af2a7c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_GetViaIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the active diagnostic settings for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSetting_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log","Metric"}, NewOutputProperties=new string[] {"Log","Metric"}, ChangeDescription="The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSetting_GetViaIdentity : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSetting_GetViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSetting_GetViaIdentity : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSetting_GetViaIdentity : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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.DiagnosticSetting.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 GetAzDiagnosticSetting_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } }); @@ -348,12 +399,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -370,7 +421,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -388,12 +439,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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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 ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_List.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_List.cs index 8e2834f44aec..08b42003cf3c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_List.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzDiagnosticSetting_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the active diagnostic settings list for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] List=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzDiagnosticSetting_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log","Metric"}, NewOutputProperties=new string[] {"Log","Metric"}, ChangeDescription="The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active diagnostic settings list for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings", ApiVersion = "2021-05-01-preview")] public partial class GetAzDiagnosticSetting_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzDiagnosticSetting_List : 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 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzDiagnosticSetting_List : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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] @@ -79,7 +100,7 @@ public partial class GetAzDiagnosticSetting_List : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,24 +137,24 @@ public partial class GetAzDiagnosticSetting_List : 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection /// 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) @@ -156,6 +177,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -177,7 +203,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzDiagnosticSetting_List() { @@ -228,8 +254,33 @@ public GetAzDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -282,7 +333,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -300,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -338,12 +389,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -360,15 +411,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId }) + 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 } }); @@ -378,12 +429,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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection /// 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 ) { @@ -395,9 +446,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResourceCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).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; + } + } } } } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzEventCategory_List.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzEventCategory_List.cs index 1892953937d4..7390ba44eb30 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzEventCategory_List.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzEventCategory_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] List=>GET:"/providers/Microsoft.Insights/eventcategories" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzEventCategory_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.ILocalizableString))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILocalizableString))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Get the list of available event categories supported in the Activity Logs Service.
The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/providers/Microsoft.Insights/eventcategories", ApiVersion = "2015-04-01")] public partial class GetAzEventCategory_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,11 +40,26 @@ public partial class GetAzEventCategory_List : global::System.Management.Automat ///
private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class GetAzEventCategory_List : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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] @@ -81,7 +102,7 @@ public partial class GetAzEventCategory_List : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -104,24 +125,24 @@ public partial class GetAzEventCategory_List : global::System.Management.Automat /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection /// 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) @@ -144,6 +165,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -165,7 +191,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzEventCategory_List() { @@ -216,8 +242,33 @@ public GetAzEventCategory_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +321,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -288,7 +339,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } }); @@ -326,12 +377,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -348,7 +399,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -366,12 +417,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.DiagnosticSetting.Models.Api20150401.IEventCategoryCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection /// 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 ) { @@ -383,9 +434,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IEventCategoryCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).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; + } + } } } } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_Get.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_Get.cs index 4efe7feae855..7b132a9a789f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_Get.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the active subscription diagnostic settings for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzSubscriptionDiagnosticSetting_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log"}, NewOutputProperties=new string[] {"Log"}, ChangeDescription="The type of the property Log will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active subscription diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzSubscriptionDiagnosticSetting_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzSubscriptionDiagnosticSetting_Get : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzSubscriptionDiagnosticSetting_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzSubscriptionDiagnosticSetting_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -125,7 +146,8 @@ public partial class GetAzSubscriptionDiagnosticSetting_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -134,24 +156,24 @@ public partial class GetAzSubscriptionDiagnosticSetting_Get : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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) @@ -174,6 +196,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -195,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzSubscriptionDiagnosticSetting_Get() { @@ -246,8 +273,33 @@ public GetAzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +352,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +373,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,12 +411,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -381,15 +433,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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, 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 } }); @@ -399,12 +451,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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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 ) { @@ -416,8 +468,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_GetViaIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_GetViaIdentity.cs index 9591cf188200..f42d306cb018 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_GetViaIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Gets the active subscription diagnostic settings for the specified resource. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzSubscriptionDiagnosticSetting_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log"}, NewOutputProperties=new string[] {"Log"}, ChangeDescription="The type of the property Log will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active subscription diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class GetAzSubscriptionDiagnosticSetting_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzSubscriptionDiagnosticSetting_GetViaIdentity : global: /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzSubscriptionDiagnosticSetting_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzSubscriptionDiagnosticSetting_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 GetAzSubscriptionDiagnosticSetting_GetViaIdentity : global: /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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.DiagnosticSetting.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 GetAzSubscriptionDiagnosticSetting_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } }); @@ -348,12 +399,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -370,7 +421,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -388,12 +439,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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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 ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_List.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_List.cs index 2cd951d3b1c3..c8a338c5f97c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_List.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/GetAzSubscriptionDiagnosticSetting_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// @@ -15,13 +17,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzSubscriptionDiagnosticSetting_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log"}, NewOutputProperties=new string[] {"Log"}, ChangeDescription="The type of the property Log will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Gets the active subscription diagnostic settings list for the specified subscriptionId.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings", ApiVersion = "2021-05-01-preview")] public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,11 +40,26 @@ public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Ma /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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] @@ -81,7 +102,7 @@ public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -113,7 +134,8 @@ public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -122,24 +144,24 @@ public partial class GetAzSubscriptionDiagnosticSetting_List : global::System.Ma /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection /// 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) @@ -162,6 +184,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -183,7 +210,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzSubscriptionDiagnosticSetting_List() { @@ -234,8 +261,33 @@ public GetAzSubscriptionDiagnosticSetting_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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -288,7 +340,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } }); @@ -347,12 +399,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -369,15 +421,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.DiagnosticSetting.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.DiagnosticSetting.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 } }); @@ -387,12 +439,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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection /// 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 ) { @@ -404,9 +456,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResourceCollection + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).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; + } + } } } } diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateExpanded.cs index 8b2bf3ad4bda..b2ce9d8bcb65 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateExpanded.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; - /// Creates or updates diagnostic settings for the specified resource. + /// create diagnostic settings for the specified resource. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDiagnosticSetting_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log","Metric"}, NewOutputProperties=new string[] {"Log","Metric"}, ChangeDescription="The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Creates or updates diagnostic settings for the specified resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The diagnostic setting resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.DiagnosticSettingsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -80,6 +98,9 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana PossibleTypes = new [] { typeof(string) })] public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -104,9 +125,9 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana ReadOnly = false, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings) })] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ILogSettings[] Log { get => _parametersBody.Log ?? null /* arrayOf */; set => _parametersBody.Log = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, @@ -145,8 +166,8 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana ReadOnly = false, Description = @"The list of metric settings.", SerializedName = @"metrics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IMetricSettings[] Metric { get => _parametersBody.Metric ?? null /* arrayOf */; set => _parametersBody.Metric = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] Metric { get => _parametersBody.Metric?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Metric = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -173,7 +194,7 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -249,24 +270,24 @@ public partial class NewAzDiagnosticSetting_CreateExpanded : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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) @@ -289,6 +310,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -353,8 +379,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -364,7 +415,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzDiagnosticSetting_CreateExpanded() { @@ -418,7 +469,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -431,12 +482,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DiagnosticSettingsCreateOrUpdate(ResourceId, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.DiagnosticSettingsCreateOrUpdate(ResourceId, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -474,12 +525,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -496,15 +547,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId, Name=Name, body=_parametersBody }) + 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 } }); @@ -514,12 +565,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.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource /// 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 ) { @@ -531,8 +582,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.IDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonFilePath.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..e4130f968f4a --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonFilePath.cs @@ -0,0 +1,505 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// create diagnostic settings for the specified resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDiagnosticSetting_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.NotSuggestDefaultParameterSet] + public partial class NewAzDiagnosticSetting_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceId; + + /// The identifier of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The identifier of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The identifier of the resource.", + SerializedName = @"resourceUri", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public string ResourceId { get => this._resourceId; set => this._resourceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 NewAzDiagnosticSetting_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DiagnosticSettingsCreateOrUpdateViaJsonString(ResourceId, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonString.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonString.cs new file mode 100644 index 000000000000..528164baf204 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzDiagnosticSetting_CreateViaJsonString.cs @@ -0,0 +1,503 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// create diagnostic settings for the specified resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzDiagnosticSetting_CreateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log","Metric"}, NewOutputProperties = new string[] {"Log","Metric" } , ChangeDescription = "The types of the properties Log and Metric will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.NotSuggestDefaultParameterSet] + public partial class NewAzDiagnosticSetting_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceId; + + /// The identifier of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The identifier of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The identifier of the resource.", + SerializedName = @"resourceUri", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public string ResourceId { get => this._resourceId; set => this._resourceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 NewAzDiagnosticSetting_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DiagnosticSettingsCreateOrUpdateViaJsonString(ResourceId, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateExpanded.cs index 2c6f0529d5da..8017ae425bba 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateExpanded.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; - /// Creates or updates subscription diagnostic settings for the specified resource. + /// create subscription diagnostic settings for the specified resource. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzSubscriptionDiagnosticSetting_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Log"}, NewOutputProperties=new string[] {"Log"}, ChangeDescription="The type of the property Log will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"Creates or updates subscription diagnostic settings for the specified resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create subscription diagnostic settings for the specified resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: /// 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; + /// The subscription diagnostic setting resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.SubscriptionDiagnosticSettingsResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -80,6 +98,9 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: PossibleTypes = new [] { typeof(string) })] public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -104,9 +125,9 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: ReadOnly = false, Description = @"The list of logs settings.", SerializedName = @"logs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings) })] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionLogSettings[] Log { get => _parametersBody.Log ?? null /* arrayOf */; set => _parametersBody.Log = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. @@ -146,7 +167,7 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -204,7 +225,8 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -226,24 +248,24 @@ public partial class NewAzSubscriptionDiagnosticSetting_CreateExpanded : global: /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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) @@ -266,6 +288,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -330,8 +357,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +393,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzSubscriptionDiagnosticSetting_CreateExpanded() { @@ -395,7 +447,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,12 +460,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdate(SubscriptionId, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdate(SubscriptionId, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -451,12 +503,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -473,15 +525,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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, Name=Name, body=_parametersBody }) + 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 } }); @@ -491,12 +543,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.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource /// 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 ) { @@ -508,8 +560,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.ISubscriptionDiagnosticSettingsResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonFilePath.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..797bea9fb9d7 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// create subscription diagnostic settings for the specified resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzSubscriptionDiagnosticSetting_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create subscription diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.NotSuggestDefaultParameterSet] + public partial class NewAzSubscriptionDiagnosticSetting_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 NewAzSubscriptionDiagnosticSetting_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SubscriptionDiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdateViaJsonString(SubscriptionId, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonString.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonString.cs new file mode 100644 index 000000000000..edd2b1316089 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/NewAzSubscriptionDiagnosticSetting_CreateViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// create subscription diagnostic settings for the specified resource. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzSubscriptionDiagnosticSetting_CreateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"Log"}, NewOutputProperties = new string[] {"Log" } , ChangeDescription = "The type of the property Log will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"create subscription diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.NotSuggestDefaultParameterSet] + public partial class NewAzSubscriptionDiagnosticSetting_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 NewAzSubscriptionDiagnosticSetting_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SubscriptionDiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdateViaJsonString(SubscriptionId, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_Delete.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_Delete.cs index f027d24de2a4..8097f87c762b 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_Delete.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Deletes existing diagnostic settings for the specified resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class RemoveAzDiagnosticSetting_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzDiagnosticSetting_Delete : global::System.Managemen /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzDiagnosticSetting_Delete : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,7 +120,7 @@ public partial class RemoveAzDiagnosticSetting_Delete : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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")] @@ -136,12 +157,12 @@ public partial class RemoveAzDiagnosticSetting_Delete : global::System.Managemen /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 @@ -184,6 +205,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -248,8 +274,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +356,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzDiagnosticSetting_Delete() { @@ -369,12 +420,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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 ) { @@ -391,15 +442,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 { ResourceId=ResourceId, 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 } }); @@ -424,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); } @@ -448,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/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_DeleteViaIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_DeleteViaIdentity.cs index e432c93ab7ae..d640db8b97c4 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_DeleteViaIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzDiagnosticSetting_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Deletes existing diagnostic settings for the specified resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class RemoveAzDiagnosticSetting_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzDiagnosticSetting_DeleteViaIdentity : global::Syste /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzDiagnosticSetting_DeleteViaIdentity : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzDiagnosticSetting_DeleteViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzDiagnosticSetting_DeleteViaIdentity : global::Syste /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 @@ -164,6 +185,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzDiagnosticSetting_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,7 +438,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -420,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); } @@ -444,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/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_Delete.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_Delete.cs index 6b1568b252e8..e5c3c914bc7b 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_Delete.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Deletes existing subscription diagnostic settings for the specified resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class RemoveAzSubscriptionDiagnosticSetting_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_Delete : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,7 +120,7 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_Delete : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 RemoveAzSubscriptionDiagnosticSetting_Delete : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,12 +162,12 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_Delete : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 @@ -188,6 +210,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -252,8 +279,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +361,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +379,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -340,7 +392,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzSubscriptionDiagnosticSetting_Delete() { @@ -373,12 +425,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +447,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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, 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 } }); @@ -428,7 +480,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -452,7 +504,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/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity.cs index f70abd645759..e0a926ccfb9f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; using System; /// Deletes existing subscription diagnostic settings for the specified resource. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}", ApiVersion = "2021-05-01-preview")] public partial class RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity : g /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity : g /// 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.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 @@ -164,6 +185,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.DiagnosticSetting.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzSubscriptionDiagnosticSetting_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20150401.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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,7 +438,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.DiagnosticSetting.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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 } @@ -420,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); } @@ -444,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/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateExpanded.cs new file mode 100644 index 000000000000..481843014e03 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateExpanded.cs @@ -0,0 +1,649 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// update diagnostic settings for the specified resource. + /// + /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDiagnosticSetting_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"update diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + public partial class UpdateAzDiagnosticSetting_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; + + /// The diagnostic setting resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The resource Id for the event hub authorization rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource Id for the event hub authorization rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id for the event hub authorization rule.", + SerializedName = @"eventHubAuthorizationRuleId", + PossibleTypes = new [] { typeof(string) })] + public string EventHubAuthorizationRuleId { get => _parametersBody.EventHubAuthorizationRuleId ?? null; set => _parametersBody.EventHubAuthorizationRuleId = value; } + + /// + /// The name of the event hub. If none is specified, the default event hub will be selected. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the event hub. If none is specified, the default event hub will be selected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; } } + + /// The list of logs settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of logs settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of logs settings.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, + /// or use a destination type constructed as follows: _. Possible values + /// are: Dedicated and null (null is default.) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)", + SerializedName = @"logAnalyticsDestinationType", + PossibleTypes = new [] { typeof(string) })] + public string LogAnalyticsDestinationType { get => _parametersBody.LogAnalyticsDestinationType ?? null; set => _parametersBody.LogAnalyticsDestinationType = value; } + + /// + /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", + SerializedName = @"marketplacePartnerId", + PossibleTypes = new [] { typeof(string) })] + public string MarketplacePartnerId { get => _parametersBody.MarketplacePartnerId ?? null; set => _parametersBody.MarketplacePartnerId = value; } + + /// The list of metric settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of metric settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of metric settings.", + SerializedName = @"metrics", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] Metric { get => _parametersBody.Metric?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Metric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceId; + + /// The identifier of the resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The identifier of the resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The identifier of the resource.", + SerializedName = @"resourceUri", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// + /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", + SerializedName = @"serviceBusRuleId", + PossibleTypes = new [] { typeof(string) })] + public string ServiceBusRuleId { get => _parametersBody.ServiceBusRuleId ?? null; set => _parametersBody.ServiceBusRuleId = value; } + + /// + /// The resource ID of the storage account to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the storage account to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _parametersBody.StorageAccountId ?? null; set => _parametersBody.StorageAccountId = value; } + + /// + /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", + SerializedName = @"workspaceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceId { get => _parametersBody.WorkspaceId ?? null; set => _parametersBody.WorkspaceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.DiagnosticSettingsGetWithResult(ResourceId, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.DiagnosticSettingsCreateOrUpdate(ResourceId, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceId=ResourceId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDiagnosticSetting_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageAccountId"))) + { + this.StorageAccountId = (string)(this.MyInvocation?.BoundParameters["StorageAccountId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceBusRuleId"))) + { + this.ServiceBusRuleId = (string)(this.MyInvocation?.BoundParameters["ServiceBusRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubAuthorizationRuleId"))) + { + this.EventHubAuthorizationRuleId = (string)(this.MyInvocation?.BoundParameters["EventHubAuthorizationRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubName"))) + { + this.EventHubName = (string)(this.MyInvocation?.BoundParameters["EventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Metric"))) + { + this.Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[])(this.MyInvocation?.BoundParameters["Metric"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Log"))) + { + this.Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[])(this.MyInvocation?.BoundParameters["Log"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("WorkspaceId"))) + { + this.WorkspaceId = (string)(this.MyInvocation?.BoundParameters["WorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplacePartnerId"))) + { + this.MarketplacePartnerId = (string)(this.MyInvocation?.BoundParameters["MarketplacePartnerId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogAnalyticsDestinationType"))) + { + this.LogAnalyticsDestinationType = (string)(this.MyInvocation?.BoundParameters["LogAnalyticsDestinationType"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateViaIdentityExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..67107fcfc2da --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzDiagnosticSetting_UpdateViaIdentityExpanded.cs @@ -0,0 +1,647 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// update diagnostic settings for the specified resource. + /// + /// [OpenAPI] Get=>GET:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzDiagnosticSetting_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"update diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + public partial class UpdateAzDiagnosticSetting_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; + + /// The diagnostic setting resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.DiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The resource Id for the event hub authorization rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource Id for the event hub authorization rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id for the event hub authorization rule.", + SerializedName = @"eventHubAuthorizationRuleId", + PossibleTypes = new [] { typeof(string) })] + public string EventHubAuthorizationRuleId { get => _parametersBody.EventHubAuthorizationRuleId ?? null; set => _parametersBody.EventHubAuthorizationRuleId = value; } + + /// + /// The name of the event hub. If none is specified, the default event hub will be selected. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the event hub. If none is specified, the default event hub will be selected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The list of logs settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of logs settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of logs settings.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, + /// or use a destination type constructed as follows: _. Possible values + /// are: Dedicated and null (null is default.) + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)", + SerializedName = @"logAnalyticsDestinationType", + PossibleTypes = new [] { typeof(string) })] + public string LogAnalyticsDestinationType { get => _parametersBody.LogAnalyticsDestinationType ?? null; set => _parametersBody.LogAnalyticsDestinationType = value; } + + /// + /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", + SerializedName = @"marketplacePartnerId", + PossibleTypes = new [] { typeof(string) })] + public string MarketplacePartnerId { get => _parametersBody.MarketplacePartnerId ?? null; set => _parametersBody.MarketplacePartnerId = value; } + + /// The list of metric settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of metric settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of metric settings.", + SerializedName = @"metrics", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[] Metric { get => _parametersBody.Metric?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Metric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", + SerializedName = @"serviceBusRuleId", + PossibleTypes = new [] { typeof(string) })] + public string ServiceBusRuleId { get => _parametersBody.ServiceBusRuleId ?? null; set => _parametersBody.ServiceBusRuleId = value; } + + /// + /// The resource ID of the storage account to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the storage account to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _parametersBody.StorageAccountId ?? null; set => _parametersBody.StorageAccountId = value; } + + /// + /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", + SerializedName = @"workspaceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceId { get => _parametersBody.WorkspaceId ?? null; set => _parametersBody.WorkspaceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.DiagnosticSettingsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.DiagnosticSettingsCreateOrUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceUri) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceUri"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.DiagnosticSettingsGetWithResult(InputObject.ResourceUri ?? null, InputObject.Name ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.DiagnosticSettingsCreateOrUpdate(InputObject.ResourceUri ?? null, InputObject.Name ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzDiagnosticSetting_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageAccountId"))) + { + this.StorageAccountId = (string)(this.MyInvocation?.BoundParameters["StorageAccountId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceBusRuleId"))) + { + this.ServiceBusRuleId = (string)(this.MyInvocation?.BoundParameters["ServiceBusRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubAuthorizationRuleId"))) + { + this.EventHubAuthorizationRuleId = (string)(this.MyInvocation?.BoundParameters["EventHubAuthorizationRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubName"))) + { + this.EventHubName = (string)(this.MyInvocation?.BoundParameters["EventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Metric"))) + { + this.Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IMetricSettings[])(this.MyInvocation?.BoundParameters["Metric"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Log"))) + { + this.Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ILogSettings[])(this.MyInvocation?.BoundParameters["Log"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("WorkspaceId"))) + { + this.WorkspaceId = (string)(this.MyInvocation?.BoundParameters["WorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplacePartnerId"))) + { + this.MarketplacePartnerId = (string)(this.MyInvocation?.BoundParameters["MarketplacePartnerId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LogAnalyticsDestinationType"))) + { + this.LogAnalyticsDestinationType = (string)(this.MyInvocation?.BoundParameters["LogAnalyticsDestinationType"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.IDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.IDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateExpanded.cs new file mode 100644 index 000000000000..8930a8ec93f1 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateExpanded.cs @@ -0,0 +1,619 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// update subscription diagnostic settings for the specified resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzSubscriptionDiagnosticSetting_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"update subscription diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + public partial class UpdateAzSubscriptionDiagnosticSetting_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; + + /// The subscription diagnostic setting resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The resource Id for the event hub authorization rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource Id for the event hub authorization rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id for the event hub authorization rule.", + SerializedName = @"eventHubAuthorizationRuleId", + PossibleTypes = new [] { typeof(string) })] + public string EventHubAuthorizationRuleId { get => _parametersBody.EventHubAuthorizationRuleId ?? null; set => _parametersBody.EventHubAuthorizationRuleId = value; } + + /// + /// The name of the event hub. If none is specified, the default event hub will be selected. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the event hub. If none is specified, the default event hub will be selected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; } } + + /// The list of logs settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of logs settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of logs settings.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", + SerializedName = @"marketplacePartnerId", + PossibleTypes = new [] { typeof(string) })] + public string MarketplacePartnerId { get => _parametersBody.MarketplacePartnerId ?? null; set => _parametersBody.MarketplacePartnerId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the diagnostic setting. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the diagnostic setting.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the diagnostic setting.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", + SerializedName = @"serviceBusRuleId", + PossibleTypes = new [] { typeof(string) })] + public string ServiceBusRuleId { get => _parametersBody.ServiceBusRuleId ?? null; set => _parametersBody.ServiceBusRuleId = value; } + + /// + /// The resource ID of the storage account to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the storage account to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _parametersBody.StorageAccountId ?? null; set => _parametersBody.StorageAccountId = 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.DiagnosticSetting.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", + SerializedName = @"workspaceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceId { get => _parametersBody.WorkspaceId ?? null; set => _parametersBody.WorkspaceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SubscriptionDiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.SubscriptionDiagnosticSettingsGetWithResult(SubscriptionId, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdate(SubscriptionId, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzSubscriptionDiagnosticSetting_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageAccountId"))) + { + this.StorageAccountId = (string)(this.MyInvocation?.BoundParameters["StorageAccountId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceBusRuleId"))) + { + this.ServiceBusRuleId = (string)(this.MyInvocation?.BoundParameters["ServiceBusRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubAuthorizationRuleId"))) + { + this.EventHubAuthorizationRuleId = (string)(this.MyInvocation?.BoundParameters["EventHubAuthorizationRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubName"))) + { + this.EventHubName = (string)(this.MyInvocation?.BoundParameters["EventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Log"))) + { + this.Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[])(this.MyInvocation?.BoundParameters["Log"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("WorkspaceId"))) + { + this.WorkspaceId = (string)(this.MyInvocation?.BoundParameters["WorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplacePartnerId"))) + { + this.MarketplacePartnerId = (string)(this.MyInvocation?.BoundParameters["MarketplacePartnerId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..db9f2de27d74 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/cmdlets/UpdateAzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded.cs @@ -0,0 +1,613 @@ +// 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.DiagnosticSetting.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Cmdlets; + using System; + + /// update subscription diagnostic settings for the specified resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/diagnosticSettings/{name}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Description(@"update subscription diagnostic settings for the specified resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Generated] + public partial class UpdateAzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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; + + /// The subscription diagnostic setting resource. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.SubscriptionDiagnosticSettingsResource(); + + /// + /// 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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The resource Id for the event hub authorization rule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource Id for the event hub authorization rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource Id for the event hub authorization rule.", + SerializedName = @"eventHubAuthorizationRuleId", + PossibleTypes = new [] { typeof(string) })] + public string EventHubAuthorizationRuleId { get => _parametersBody.EventHubAuthorizationRuleId ?? null; set => _parametersBody.EventHubAuthorizationRuleId = value; } + + /// + /// The name of the event hub. If none is specified, the default event hub will be selected. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the event hub. If none is specified, the default event hub will be selected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the event hub. If none is specified, the default event hub will be selected.", + SerializedName = @"eventHubName", + PossibleTypes = new [] { typeof(string) })] + public string EventHubName { get => _parametersBody.EventHubName ?? null; set => _parametersBody.EventHubName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.IDiagnosticSettingIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The list of logs settings. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of logs settings.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of logs settings.", + SerializedName = @"logs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.ParameterBreakingChange("Log", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[] Log { get => _parametersBody.Log?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Log = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.", + SerializedName = @"marketplacePartnerId", + PossibleTypes = new [] { typeof(string) })] + public string MarketplacePartnerId { get => _parametersBody.MarketplacePartnerId ?? null; set => _parametersBody.MarketplacePartnerId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.", + SerializedName = @"serviceBusRuleId", + PossibleTypes = new [] { typeof(string) })] + public string ServiceBusRuleId { get => _parametersBody.ServiceBusRuleId ?? null; set => _parametersBody.ServiceBusRuleId = value; } + + /// + /// The resource ID of the storage account to which you would like to send Diagnostic Logs. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the storage account to which you would like to send Diagnostic Logs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the storage account to which you would like to send Diagnostic Logs.", + SerializedName = @"storageAccountId", + PossibleTypes = new [] { typeof(string) })] + public string StorageAccountId { get => _parametersBody.StorageAccountId ?? null; set => _parametersBody.StorageAccountId = value; } + + /// + /// The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2", + SerializedName = @"workspaceId", + PossibleTypes = new [] { typeof(string) })] + public string WorkspaceId { get => _parametersBody.WorkspaceId ?? null; set => _parametersBody.WorkspaceId = 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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'SubscriptionDiagnosticSettingsCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.SubscriptionDiagnosticSettingsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Name) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Name"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.SubscriptionDiagnosticSettingsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.Name ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.SubscriptionDiagnosticSettingsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.Name ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzSubscriptionDiagnosticSetting_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("StorageAccountId"))) + { + this.StorageAccountId = (string)(this.MyInvocation?.BoundParameters["StorageAccountId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ServiceBusRuleId"))) + { + this.ServiceBusRuleId = (string)(this.MyInvocation?.BoundParameters["ServiceBusRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubAuthorizationRuleId"))) + { + this.EventHubAuthorizationRuleId = (string)(this.MyInvocation?.BoundParameters["EventHubAuthorizationRuleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("EventHubName"))) + { + this.EventHubName = (string)(this.MyInvocation?.BoundParameters["EventHubName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Log"))) + { + this.Log = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.ISubscriptionLogSettings[])(this.MyInvocation?.BoundParameters["Log"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("WorkspaceId"))) + { + this.WorkspaceId = (string)(this.MyInvocation?.BoundParameters["WorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("MarketplacePartnerId"))) + { + this.MarketplacePartnerId = (string)(this.MyInvocation?.BoundParameters["MarketplacePartnerId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + /// 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.DiagnosticSetting.Models.ISubscriptionDiagnosticSettingsResource + 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/DiagnosticSetting.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..bcca8bfb0ff2 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting +{ + 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/DiagnosticSetting.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..449720f3a96d --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting +{ + 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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index b91a01bc3cb5..eb4843ae8325 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index e5eee747922f..f8569300adc6 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index ba52bf1fa644..992c9fdcf6f9 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 1323786caae1..c699176149ce 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index e3d6588854dd..2e69d25858bb 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 9aac527984af..314bedae5b92 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 9e788048e407..88ad3308de33 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index f9513db40c0a..5eaa583395bf 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 549c8038e05e..426eab1372bc 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 9bd4b5e75b89..ed464bf43085 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 16261640338c..3ba3649d5908 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 558b7f6c8439..6065b6d5c88a 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Runtime.P { 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/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsHelpers.cs index b0580aef8357..ea8052655962 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/Context.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..cd32a671b826 --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.DiagnosticSetting Client { get; } + } +} diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Events.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Events.cs index 77aea5420934..41010f47c79e 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/ISendAsync.cs index 8f307e389f6b..2b7146a2f2be 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/InfoAttribute.cs index 15bac972b669..2e1640e3a4fa 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..fac172e6a59c --- /dev/null +++ b/generated/Monitor/DiagnosticSetting.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.DiagnosticSetting.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.DiagnosticSetting.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/MessageAttribute.cs index a7d0ce2ad259..9da4339ddeb9 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.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.DiagnosticSetting" : @"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/DiagnosticSetting.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index cf74959f4af3..476884319622 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/SerializationMode.cs index 55cca937c539..bea88b744c22 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/TypeConverterExtensions.cs index 8885f8b0d1e3..dd0c87fe20b8 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/DiagnosticSetting.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/DiagnosticSetting.Autorest/test-module.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/test-module.ps1 index 8bea768e5019..3026e1acb19c 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/test-module.ps1 +++ b/generated/Monitor/DiagnosticSetting.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/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.format.ps1xml b/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.format.ps1xml index 17118eadfdf0..07179242a450 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.format.ps1xml +++ b/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.format.ps1xml @@ -2,33 +2,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomProperties#Multiple - - - - - - - + - ResourceGroupName - - - RuleName - - - SubscriptionId + Item @@ -36,51 +24,57 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition#Multiple - + - + - + - + - + - + + + + - CreatedAt + MetricMeasureColumn - CreatedBy + MetricName - CreatedByType + Operator - LastModifiedAt + Query - LastModifiedBy + ResourceIdColumn - LastModifiedByType + Threshold + + + TimeAggregation @@ -88,21 +82,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Actions + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriods - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Actions + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriods#Multiple - + + + + - ActionGroup + MinFailingPeriodsToAlert + + + NumberOfEvaluationPeriod @@ -110,21 +110,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension#Multiple - + + + + - Item + Name + + + Operator @@ -132,57 +138,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse#Multiple - - - - - - - - - - - - - + - + - + - MetricMeasureColumn - - - MetricName - - - Operator - - - Query - - - ResourceIdColumn + Code - Threshold + Message - TimeAggregation + Target @@ -190,27 +172,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriods + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriods + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Resource#Multiple - - - - + - MinFailingPeriodsToAlert - - - NumberOfEvaluationPeriod + Name @@ -218,33 +194,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleIdentity#Multiple - + - + - + - Name + ResourceGroupName - Operator + RuleName - Value + SubscriptionId @@ -252,9 +228,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties#Multiple @@ -282,18 +258,12 @@ - - - - - - @@ -322,27 +292,21 @@ IsWorkspaceAlertsStorageConfigured - - Scope - Severity SkipQueryValidation - - TargetResourceType - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource#Multiple @@ -358,6 +322,9 @@ + + + @@ -374,15 +341,18 @@ Kind + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceCollection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceCollection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection#Multiple @@ -402,9 +372,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTags#Multiple @@ -424,55 +394,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemData#Multiple - + - + - + + + + + + + + + + - Code + CreatedAt - Message + CreatedBy - Target + CreatedByType - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.Resource - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.Resource - - - - - - - - - - - Name + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType @@ -480,9 +446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResource#Multiple @@ -508,9 +474,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTags#Multiple diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psd1 b/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psd1 index 074b53c8cc5e..72736976de0c 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psd1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/Az.ScheduledQueryRule.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ScheduledQueryRule.private.dll' FormatsToProcess = './Az.ScheduledQueryRule.format.ps1xml' - FunctionsToExport = 'Get-AzScheduledQueryRule', 'New-AzScheduledQueryRule', 'New-AzScheduledQueryRuleConditionObject', 'New-AzScheduledQueryRuleDimensionObject', 'Remove-AzScheduledQueryRule', 'Update-AzScheduledQueryRule', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzScheduledQueryRule', 'New-AzScheduledQueryRule', 'New-AzScheduledQueryRuleConditionObject', 'New-AzScheduledQueryRuleDimensionObject', 'Remove-AzScheduledQueryRule', 'Update-AzScheduledQueryRule' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ScheduledQueryRule' diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/ScheduledQueryRule.Autorest/Properties/AssemblyInfo.cs index 405a916b491b..83073b9b8b3b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/ScheduledQueryRule.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 - ScheduledQueryRule")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] -[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.3")] +[assembly: System.Reflection.AssemblyVersionAttribute("6.0.3")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/check-dependencies.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 index d38d6acbf248..4a051a847efd 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 @@ -29,7 +29,7 @@ Get-AzScheduledQueryRule -ResourceGroupName "test-group" -Name "test-rule" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azscheduledqueryrule #> function Get-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -74,7 +74,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -157,9 +165,7 @@ begin { List = 'Az.ScheduledQueryRule.private\Get-AzScheduledQueryRule_List'; List1 = 'Az.ScheduledQueryRule.private\Get-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -173,6 +179,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/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 index f82ea2103183..ba287756b762 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates or updates a scheduled query rule. +Create a scheduled query rule. .Description -Creates or updates a scheduled query rule. +Create a scheduled query rule. .Example $subscriptionId=(Get-AzContext).Subscription.Id $dimension = New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator Include -Value * @@ -26,31 +26,31 @@ $condition=New-AzScheduledQueryRuleConditionObject -Dimension $dimension -Query New-AzScheduledQueryRule -Name test-rule -ResourceGroupName test-group -Location eastus -DisplayName test-rule -Scope "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachines/test-vm" -Severity 4 -WindowSize ([System.TimeSpan]::New(0,10,0)) -EvaluationFrequency ([System.TimeSpan]::New(0,5,0)) -CriterionAllOf $condition .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. CRITERIONALLOF : A list of conditions to evaluate against the specified scopes - [Dimension ]: List of Dimensions conditions + [Dimension >]: List of Dimensions conditions Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values [FailingPeriodMinFailingPeriodsToAlert ]: The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 [FailingPeriodNumberOfEvaluationPeriod ]: The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 [MetricMeasureColumn ]: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. [MetricName ]: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. - [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. + [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. [Query ]: Log query alert [ResourceIdColumn ]: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. [Threshold ]: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. - [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. + [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azscheduledqueryrule #> function New-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -73,27 +73,27 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties]))] [System.Collections.Hashtable] # The properties of an alert payload. ${ActionCustomProperty}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # Action Group resource Ids to invoke when the alert fires. ${ActionGroupResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag that indicates whether the alert should be automatically resolved or not. @@ -101,7 +101,7 @@ param( # Relevant only for rules of the kind LogAlert. ${AutoMitigate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule should be stored in the customer's storage. @@ -109,70 +109,69 @@ param( # Relevant only for rules of the kind LogAlert. ${CheckWorkspaceAlertsStorageConfigured}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[]] # A list of conditions to evaluate against the specified scopes - # To construct, see NOTES section for CRITERIONALLOF properties and create a hash table. ${CriterionAllOf}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The description of the scheduled query rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The display name of the alert rule ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule is enabled. # Value should be true or false ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # How often the scheduled query rule is evaluated represented in ISO 8601 duration format. # Relevant and required only for rules of the kind LogAlert. ${EvaluationFrequency}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("LogAlert", "LogToMetric")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind] + [System.String] # Indicates the type of scheduled query rule. # The default is LogAlert. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. # Relevant only for rules of the kind LogAlert. ${MuteActionsDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). # Relevant only for rules of the kind LogAlert. ${OverrideQueryTimeRange}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # The list of resource id's that this scheduled query rule is scoped to. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Int64] # Severity of the alert. @@ -181,7 +180,7 @@ param( # Relevant and required only for rules of the kind LogAlert. ${Severity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether the provided query should be validated or not. @@ -189,14 +188,14 @@ param( # Relevant only for rules of the kind LogAlert. ${SkipQueryValidation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] @@ -205,13 +204,25 @@ param( # Relevant only for rules of the kind LogAlert ${TargetResourceType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). # Relevant and required only for rules of the kind LogAlert. ${WindowSize}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -268,6 +279,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -288,10 +308,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -305,6 +325,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/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleConditionObject.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleConditionObject.ps1 index 19a21b589649..acb58ecfc381 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleConditionObject.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleConditionObject.ps1 @@ -24,7 +24,7 @@ $dimension = New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator In New-AzScheduledQueryRuleConditionObject -Dimension $dimension -Query "Perf | where ObjectName == `"Processor`" and CounterName == `"% Processor Time`" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 5m), Computer" -TimeAggregation "Average" -MetricMeasureColumn "AggregatedValue" -Operator "GreaterThan" -Threshold "70" -FailingPeriodNumberOfEvaluationPeriod 1 -FailingPeriodMinFailingPeriodsToAlert 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition .Notes COMPLEX PARAMETER PROPERTIES @@ -32,20 +32,19 @@ To create the parameters described below, construct a hash table containing the DIMENSION : List of Dimensions conditions. Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruleconditionobject #> function New-AzScheduledQueryRuleConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension[]] # List of Dimensions conditions. - # To construct, see NOTES section for DIMENSION properties and create a hash table. ${Dimension}, [Parameter()] @@ -79,9 +78,9 @@ param( ${MetricName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator] + [System.String] # The criteria operator. # Relevant and required only for rules of the kind LogAlert. ${Operator}, @@ -108,9 +107,9 @@ param( ${Threshold}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Count", "Average", "Minimum", "Maximum", "Total")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation] + [System.String] # Aggregation type. # Relevant and required only for rules of the kind LogAlert. ${TimeAggregation} @@ -123,6 +122,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -151,6 +153,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/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleDimensionObject.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleDimensionObject.ps1 index efdeb26ca5cb..975ca6da6a4d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleDimensionObject.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRuleDimensionObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for Dimension. New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator Include -Value * .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleDimensionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruledimensionobject #> function New-AzScheduledQueryRuleDimensionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -38,9 +38,9 @@ param( ${Name}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Include", "Exclude")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator] + [System.String] # Operator for dimension values. ${Operator}, @@ -58,6 +58,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -86,6 +89,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/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 index b82755619088..3db7be575590 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -29,7 +29,7 @@ Get-AzScheduledQueryRule -ResourceGroupName "test-group" -Name "test-rule" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azscheduledqueryrule #> function Get-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -74,7 +74,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -157,9 +165,7 @@ begin { List = 'Az.ScheduledQueryRule.private\Get-AzScheduledQueryRule_List'; List1 = 'Az.ScheduledQueryRule.private\Get-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -173,6 +179,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) @@ -218,9 +227,9 @@ end { <# .Synopsis -Creates or updates a scheduled query rule. +Create a scheduled query rule. .Description -Creates or updates a scheduled query rule. +Create a scheduled query rule. .Example $subscriptionId=(Get-AzContext).Subscription.Id $dimension = New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator Include -Value * @@ -228,31 +237,31 @@ $condition=New-AzScheduledQueryRuleConditionObject -Dimension $dimension -Query New-AzScheduledQueryRule -Name test-rule -ResourceGroupName test-group -Location eastus -DisplayName test-rule -Scope "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachines/test-vm" -Severity 4 -WindowSize ([System.TimeSpan]::New(0,10,0)) -EvaluationFrequency ([System.TimeSpan]::New(0,5,0)) -CriterionAllOf $condition .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. CRITERIONALLOF : A list of conditions to evaluate against the specified scopes - [Dimension ]: List of Dimensions conditions + [Dimension >]: List of Dimensions conditions Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values [FailingPeriodMinFailingPeriodsToAlert ]: The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 [FailingPeriodNumberOfEvaluationPeriod ]: The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 [MetricMeasureColumn ]: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. [MetricName ]: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. - [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. + [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. [Query ]: Log query alert [ResourceIdColumn ]: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. [Threshold ]: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. - [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. + [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. .Link https://learn.microsoft.com/powershell/module/az.monitor/new-azscheduledqueryrule #> function New-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -275,27 +284,27 @@ param( # The ID of the target subscription. ${SubscriptionId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties]))] [System.Collections.Hashtable] # The properties of an alert payload. ${ActionCustomProperty}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # Action Group resource Ids to invoke when the alert fires. ${ActionGroupResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag that indicates whether the alert should be automatically resolved or not. @@ -303,7 +312,7 @@ param( # Relevant only for rules of the kind LogAlert. ${AutoMitigate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule should be stored in the customer's storage. @@ -311,70 +320,69 @@ param( # Relevant only for rules of the kind LogAlert. ${CheckWorkspaceAlertsStorageConfigured}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[]] # A list of conditions to evaluate against the specified scopes - # To construct, see NOTES section for CRITERIONALLOF properties and create a hash table. ${CriterionAllOf}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The description of the scheduled query rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The display name of the alert rule ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule is enabled. # Value should be true or false ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # How often the scheduled query rule is evaluated represented in ISO 8601 duration format. # Relevant and required only for rules of the kind LogAlert. ${EvaluationFrequency}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("LogAlert", "LogToMetric")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind] + [System.String] # Indicates the type of scheduled query rule. # The default is LogAlert. ${Kind}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. # Relevant only for rules of the kind LogAlert. ${MuteActionsDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). # Relevant only for rules of the kind LogAlert. ${OverrideQueryTimeRange}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # The list of resource id's that this scheduled query rule is scoped to. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Int64] # Severity of the alert. @@ -383,7 +391,7 @@ param( # Relevant and required only for rules of the kind LogAlert. ${Severity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether the provided query should be validated or not. @@ -391,14 +399,14 @@ param( # Relevant only for rules of the kind LogAlert. ${SkipQueryValidation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] @@ -407,13 +415,25 @@ param( # Relevant only for rules of the kind LogAlert ${TargetResourceType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). # Relevant and required only for rules of the kind LogAlert. ${WindowSize}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -470,6 +490,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -490,10 +519,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ScheduledQueryRule.private\New-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -507,6 +536,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) @@ -603,7 +635,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -668,6 +699,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -690,9 +730,7 @@ begin { Delete = 'Az.ScheduledQueryRule.private\Remove-AzScheduledQueryRule_Delete'; DeleteViaIdentity = 'Az.ScheduledQueryRule.private\Remove-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -706,6 +744,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) @@ -761,26 +802,26 @@ Update-AzScheduledQueryRule -Name test-rule -ResourceGroupName test-group -Scope .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. CRITERIONALLOF : A list of conditions to evaluate against the specified scopes - [Dimension ]: List of Dimensions conditions + [Dimension >]: List of Dimensions conditions Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values [FailingPeriodMinFailingPeriodsToAlert ]: The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 [FailingPeriodNumberOfEvaluationPeriod ]: The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 [MetricMeasureColumn ]: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. [MetricName ]: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. - [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. + [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. [Query ]: Log query alert [ResourceIdColumn ]: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. [Threshold ]: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. - [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. + [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. INPUTOBJECT : Identity Parameter [Id ]: Resource identity path @@ -791,16 +832,20 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azscheduledqueryrule #> function Update-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [System.String] # The name of the rule. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [System.String] # The name of the resource group. @@ -808,6 +853,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -818,24 +865,26 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # 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.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties]))] [System.Collections.Hashtable] # The properties of an alert payload. ${ActionCustomProperty}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # Action Group resource Ids to invoke when the alert fires. ${ActionGroupResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag that indicates whether the alert should be automatically resolved or not. @@ -843,7 +892,8 @@ param( # Relevant only for rules of the kind LogAlert. ${AutoMitigate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule should be stored in the customer's storage. @@ -851,62 +901,70 @@ param( # Relevant only for rules of the kind LogAlert. ${CheckWorkspaceAlertsStorageConfigured}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[]] # A list of conditions to evaluate against the specified scopes - # To construct, see NOTES section for CRITERIONALLOF properties and create a hash table. ${CriterionAllOf}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The description of the scheduled query rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The display name of the alert rule ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule is enabled. # Value should be true or false ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # How often the scheduled query rule is evaluated represented in ISO 8601 duration format. # Relevant and required only for rules of the kind LogAlert. ${EvaluationFrequency}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. # Relevant only for rules of the kind LogAlert. ${MuteActionsDuration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). # Relevant only for rules of the kind LogAlert. ${OverrideQueryTimeRange}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # The list of resource id's that this scheduled query rule is scoped to. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Int64] # Severity of the alert. @@ -915,7 +973,8 @@ param( # Relevant and required only for rules of the kind LogAlert. ${Severity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether the provided query should be validated or not. @@ -923,14 +982,16 @@ param( # Relevant only for rules of the kind LogAlert. ${SkipQueryValidation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] @@ -939,13 +1000,26 @@ param( # Relevant only for rules of the kind LogAlert ${TargetResourceType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). # Relevant and required only for rules of the kind LogAlert. ${WindowSize}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1002,6 +1076,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1023,10 +1106,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -1040,6 +1123,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) @@ -1093,7 +1179,7 @@ $dimension = New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator In New-AzScheduledQueryRuleConditionObject -Dimension $dimension -Query "Perf | where ObjectName == `"Processor`" and CounterName == `"% Processor Time`" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 5m), Computer" -TimeAggregation "Average" -MetricMeasureColumn "AggregatedValue" -Operator "GreaterThan" -Threshold "70" -FailingPeriodNumberOfEvaluationPeriod 1 -FailingPeriodMinFailingPeriodsToAlert 1 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition .Notes COMPLEX PARAMETER PROPERTIES @@ -1101,20 +1187,19 @@ To create the parameters described below, construct a hash table containing the DIMENSION : List of Dimensions conditions. Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleConditionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruleconditionobject #> function New-AzScheduledQueryRuleConditionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension[]] # List of Dimensions conditions. - # To construct, see NOTES section for DIMENSION properties and create a hash table. ${Dimension}, [Parameter()] @@ -1148,9 +1233,9 @@ param( ${MetricName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator] + [System.String] # The criteria operator. # Relevant and required only for rules of the kind LogAlert. ${Operator}, @@ -1177,9 +1262,9 @@ param( ${Threshold}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Count", "Average", "Minimum", "Maximum", "Total")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation] + [System.String] # Aggregation type. # Relevant and required only for rules of the kind LogAlert. ${TimeAggregation} @@ -1192,6 +1277,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1220,6 +1308,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) @@ -1272,12 +1363,12 @@ Create an in-memory object for Dimension. New-AzScheduledQueryRuleDimensionObject -Name Computer -Operator Include -Value * .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension .Link -https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzScheduledQueryRuleDimensionObject +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azscheduledqueryruledimensionobject #> function New-AzScheduledQueryRuleDimensionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1287,9 +1378,9 @@ param( ${Name}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator])] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Include", "Exclude")] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator] + [System.String] # Operator for dimension values. ${Operator}, @@ -1307,6 +1398,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1335,6 +1429,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/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 index 5473997eb6ef..f04b5f0f1249 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -132,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -154,9 +162,7 @@ begin { Delete = 'Az.ScheduledQueryRule.private\Remove-AzScheduledQueryRule_Delete'; DeleteViaIdentity = 'Az.ScheduledQueryRule.private\Remove-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -170,6 +176,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/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 index 0deccfb8efda..065271f04069 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 @@ -26,26 +26,26 @@ Update-AzScheduledQueryRule -Name test-rule -ResourceGroupName test-group -Scope .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. CRITERIONALLOF : A list of conditions to evaluate against the specified scopes - [Dimension ]: List of Dimensions conditions + [Dimension >]: List of Dimensions conditions Name : Name of the dimension - Operator : Operator for dimension values - Value : List of dimension values + Operator : Operator for dimension values + Value >: List of dimension values [FailingPeriodMinFailingPeriodsToAlert ]: The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1 [FailingPeriodNumberOfEvaluationPeriod ]: The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1 [MetricMeasureColumn ]: The column containing the metric measure number. Relevant only for rules of the kind LogAlert. [MetricName ]: The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. - [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. + [Operator ]: The criteria operator. Relevant and required only for rules of the kind LogAlert. [Query ]: Log query alert [ResourceIdColumn ]: The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert. [Threshold ]: the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. - [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. + [TimeAggregation ]: Aggregation type. Relevant and required only for rules of the kind LogAlert. INPUTOBJECT : Identity Parameter [Id ]: Resource identity path @@ -56,16 +56,20 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azscheduledqueryrule #> function Update-AzScheduledQueryRule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [System.String] # The name of the rule. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [System.String] # The name of the resource group. @@ -73,6 +77,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -83,24 +89,26 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleIdentity] # 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.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties]))] [System.Collections.Hashtable] # The properties of an alert payload. ${ActionCustomProperty}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # Action Group resource Ids to invoke when the alert fires. ${ActionGroupResourceId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag that indicates whether the alert should be automatically resolved or not. @@ -108,7 +116,8 @@ param( # Relevant only for rules of the kind LogAlert. ${AutoMitigate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule should be stored in the customer's storage. @@ -116,62 +125,70 @@ param( # Relevant only for rules of the kind LogAlert. ${CheckWorkspaceAlertsStorageConfigured}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[]] # A list of conditions to evaluate against the specified scopes - # To construct, see NOTES section for CRITERIONALLOF properties and create a hash table. ${CriterionAllOf}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The description of the scheduled query rule. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String] # The display name of the alert rule ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether this scheduled query rule is enabled. # Value should be true or false ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # How often the scheduled query rule is evaluated represented in ISO 8601 duration format. # Relevant and required only for rules of the kind LogAlert. ${EvaluationFrequency}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. # Relevant only for rules of the kind LogAlert. ${MuteActionsDuration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). # Relevant only for rules of the kind LogAlert. ${OverrideQueryTimeRange}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] # The list of resource id's that this scheduled query rule is scoped to. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Int64] # Severity of the alert. @@ -180,7 +197,8 @@ param( # Relevant and required only for rules of the kind LogAlert. ${Severity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.Management.Automation.SwitchParameter] # The flag which indicates whether the provided query should be validated or not. @@ -188,14 +206,16 @@ param( # Relevant only for rules of the kind LogAlert. ${SkipQueryValidation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.String[]] @@ -204,13 +224,26 @@ param( # Relevant only for rules of the kind LogAlert ${TargetResourceType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] [System.TimeSpan] # The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). # Relevant and required only for rules of the kind LogAlert. ${WindowSize}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -267,6 +300,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -288,10 +330,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ScheduledQueryRule.private\Update-AzScheduledQueryRule_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.ScheduledQueryRule.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 { @@ -305,6 +347,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/ScheduledQueryRule.Autorest/generate-info.json b/generated/Monitor/ScheduledQueryRule.Autorest/generate-info.json index 3509c94e05e0..9979ccc2e45b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generate-info.json +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "53f643da-e033-4998-94da-05be732ad29b" + "generate_Id": "426487d3-fded-40e7-a1b9-f93765db761a" } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/Module.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/Module.cs index 42196fd7d30c..ab22929ebb26 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/Module.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule"; + 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.ScheduledQueryRule"; + 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.ScheduledQueryRule.Runtime.Htt /// 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/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.PowerShell.cs similarity index 76% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.PowerShell.cs index 98db8b7006d7..733985c52a54 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Actions 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 Actions(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("CustomProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).CustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("CustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).CustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).CustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("CustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).CustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.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. @@ -103,37 +103,37 @@ internal Actions(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("ActionGroup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("CustomProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).CustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("CustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)this).CustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).CustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("CustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)this).CustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Actions(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.ScheduledQueryRule.Models.Api20210801.IActions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Actions(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.TypeConverter.cs index 1247a902edc5..9e84c9b3d29f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IActions ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.cs similarity index 73% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.cs index 8eb57f642ff0..82dff6449ee4 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.cs @@ -3,29 +3,29 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Actions to invoke when the alert fires. public partial class Actions : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal { /// Backing field for property. - private string[] _actionGroup; + private System.Collections.Generic.List _actionGroup; /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public string[] ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } + public System.Collections.Generic.List ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties _customProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties _customProperty; /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties CustomProperty { get => (this._customProperty = this._customProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomProperties()); set => this._customProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties CustomProperty { get => (this._customProperty = this._customProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomProperties()); set => this._customProperty = value; } /// Creates an new instance. public Actions() @@ -41,18 +41,24 @@ public partial interface IActions : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties CustomProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties CustomProperty { get; set; } } /// Actions to invoke when the alert fires. @@ -60,9 +66,9 @@ internal partial interface IActionsInternal { /// Action Group resource Ids to invoke when the alert fires. - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// The properties of an alert payload. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties CustomProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties CustomProperty { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.json.cs similarity index 92% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.json.cs index 50910182a6bc..93a9622dd5ff 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Actions.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Actions.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -65,19 +65,19 @@ internal Actions(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.R { return; } - {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ActionGroup;} - {_customProperty = If( json?.PropertyT("customProperties"), out var __jsonCustomProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomProperties.FromJson(__jsonCustomProperties) : CustomProperty;} + {_actionGroup = If( json?.PropertyT("actionGroups"), out var __jsonActionGroups) ? If( __jsonActionGroups as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _actionGroup;} + {_customProperty = If( json?.PropertyT("customProperties"), out var __jsonCustomProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomProperties.FromJson(__jsonCustomProperties) : _customProperty;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new Actions(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.PowerShell.cs similarity index 89% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.PowerShell.cs index 8c3b194e97cb..b78a6a0c3e2a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ActionsCustomProperties 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 ActionsCustomProperties(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. @@ -101,29 +101,29 @@ internal ActionsCustomProperties(global::System.Management.Automation.PSObject c } /// - /// 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.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ActionsCustomProperties(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.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ActionsCustomProperties(content); } @@ -133,7 +133,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.TypeConverter.cs index 4ff78ce5342b..1aeb04aabd49 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.cs similarity index 90% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.cs index ab2ae91ceaca..c6c77cd07492 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// The properties of an alert payload. public partial class ActionsCustomProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomPropertiesInternal { /// Creates an new instance. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.dictionary.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.dictionary.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.dictionary.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.dictionary.cs index 3a7d6f977315..98f99474ad67 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.dictionary.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.ActionsCustomProperties source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomProperties source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.json.cs similarity index 95% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.json.cs index dc0d92349aab..303c1efb84a2 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ActionsCustomProperties.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ActionsCustomProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -71,13 +71,13 @@ internal ActionsCustomProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Sche } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ActionsCustomProperties(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.PowerShell.cs index 14aa485c5273..8c7edf67c069 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Models/Any.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.cs index 72d7e6de33a3..f96b60352b05 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.json.cs index 21cb438f3fb9..a008b14d0a92 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.PowerShell.cs deleted file mode 100644 index 049a78416920..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.PowerShell.cs +++ /dev/null @@ -1,326 +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.ScheduledQueryRule.Models.Api20210801 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; - - /// scheduled query rule Definition - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRulePropertiesTypeConverter))] - public partial class ScheduledQueryRuleProperties - { - - /// - /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScheduledQueryRuleProperties(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScheduledQueryRuleProperties(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScheduledQueryRuleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ScheduledQueryRuleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - 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.ScheduledQueryRule.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(); - } - } - /// scheduled query rule Definition - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRulePropertiesTypeConverter))] - public partial interface IScheduledQueryRuleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.PowerShell.cs deleted file mode 100644 index 5fa333d0a7ec..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.PowerShell.cs +++ /dev/null @@ -1,446 +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.ScheduledQueryRule.Models.Api20210801 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; - - /// The scheduled query rule resource. - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourceTypeConverter))] - public partial class ScheduledQueryRuleResource - { - - /// - /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScheduledQueryRuleResource(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScheduledQueryRuleResource(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScheduledQueryRuleResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)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("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)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("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ScheduledQueryRuleResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind.CreateFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)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("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)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("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - 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.ScheduledQueryRule.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 scheduled query rule resource. - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourceTypeConverter))] - public partial interface IScheduledQueryRuleResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.PowerShell.cs deleted file mode 100644 index 7adadbcf8883..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.PowerShell.cs +++ /dev/null @@ -1,342 +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.ScheduledQueryRule.Models.Api20210801 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; - - /// The scheduled query rule resource for patch operations. - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourcePatchTypeConverter))] - public partial class ScheduledQueryRuleResourcePatch - { - - /// - /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Action")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsTypeConverter.ConvertFrom); - } - if (content.Contains("Criterion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); - } - if (content.Contains("CreatedWithApiVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); - } - if (content.Contains("IsLegacyLogAnalyticsRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Severity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EvaluationFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("WindowSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("OverrideQueryTimeRange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("TargetResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType = (string[]) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MuteActionsDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); - } - if (content.Contains("IsWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SkipQueryValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AutoMitigate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ActionGroup")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup = (string[]) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ActionCustomProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ActionsCustomPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("CriterionAllOf")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); - } - 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.ScheduledQueryRule.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 scheduled query rule resource for patch operations. - [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourcePatchTypeConverter))] - public partial interface IScheduledQueryRuleResourcePatch - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.PowerShell.cs similarity index 54% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.PowerShell.cs index d2186164b33b..031f1e2b8e7b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Condition 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,53 +78,53 @@ internal Condition(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("FailingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriod = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods) content.GetValueForProperty("FailingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriod, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriodsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriod = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods) content.GetValueForProperty("FailingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriod, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriodsTypeConverter.ConvertFrom); } if (content.Contains("Query")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Query = (string) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Query, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Query = (string) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Query, global::System.Convert.ToString); } if (content.Contains("TimeAggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).TimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation?) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).TimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).TimeAggregation = (string) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).TimeAggregation, global::System.Convert.ToString); } if (content.Contains("MetricMeasureColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricMeasureColumn = (string) content.GetValueForProperty("MetricMeasureColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricMeasureColumn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricMeasureColumn = (string) content.GetValueForProperty("MetricMeasureColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricMeasureColumn, global::System.Convert.ToString); } if (content.Contains("ResourceIdColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).ResourceIdColumn = (string) content.GetValueForProperty("ResourceIdColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).ResourceIdColumn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).ResourceIdColumn = (string) content.GetValueForProperty("ResourceIdColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).ResourceIdColumn, global::System.Convert.ToString); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.DimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.DimensionTypeConverter.ConvertFrom)); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Threshold")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Threshold = (double?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Threshold = (double?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("FailingPeriodNumberOfEvaluationPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod = (long?) content.GetValueForProperty("FailingPeriodNumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod = (long?) content.GetValueForProperty("FailingPeriodNumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("FailingPeriodMinFailingPeriodsToAlert")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert = (long?) content.GetValueForProperty("FailingPeriodMinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert = (long?) content.GetValueForProperty("FailingPeriodMinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,75 +139,73 @@ internal Condition(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("FailingPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriod = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods) content.GetValueForProperty("FailingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriod, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriodsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriod = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods) content.GetValueForProperty("FailingPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriod, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriodsTypeConverter.ConvertFrom); } if (content.Contains("Query")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Query = (string) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Query, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Query = (string) content.GetValueForProperty("Query",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Query, global::System.Convert.ToString); } if (content.Contains("TimeAggregation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).TimeAggregation = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation?) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).TimeAggregation, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).TimeAggregation = (string) content.GetValueForProperty("TimeAggregation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).TimeAggregation, global::System.Convert.ToString); } if (content.Contains("MetricMeasureColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricMeasureColumn = (string) content.GetValueForProperty("MetricMeasureColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricMeasureColumn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricMeasureColumn = (string) content.GetValueForProperty("MetricMeasureColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricMeasureColumn, global::System.Convert.ToString); } if (content.Contains("ResourceIdColumn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).ResourceIdColumn = (string) content.GetValueForProperty("ResourceIdColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).ResourceIdColumn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).ResourceIdColumn = (string) content.GetValueForProperty("ResourceIdColumn",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).ResourceIdColumn, global::System.Convert.ToString); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.DimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.DimensionTypeConverter.ConvertFrom)); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator?) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Threshold")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Threshold = (double?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Threshold = (double?) content.GetValueForProperty("Threshold",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).Threshold, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("MetricName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).MetricName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricName = (string) content.GetValueForProperty("MetricName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).MetricName, global::System.Convert.ToString); } if (content.Contains("FailingPeriodNumberOfEvaluationPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod = (long?) content.GetValueForProperty("FailingPeriodNumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod = (long?) content.GetValueForProperty("FailingPeriodNumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodNumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("FailingPeriodMinFailingPeriodsToAlert")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert = (long?) content.GetValueForProperty("FailingPeriodMinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert = (long?) content.GetValueForProperty("FailingPeriodMinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal)this).FailingPeriodMinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } 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.ScheduledQueryRule.Models.Api20210801.ICondition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Condition(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.ScheduledQueryRule.Models.Api20210801.ICondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Condition(content); } @@ -217,7 +215,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.TypeConverter.cs index 1d93ff1042fd..6187a40447e1 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.ICondition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.cs similarity index 78% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.cs index 28a59e71105e..12e517454386 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.cs @@ -3,46 +3,46 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// A condition of the scheduled query rule. public partial class Condition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[] _dimension; + private System.Collections.Generic.List _dimension; /// List of Dimensions conditions [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + public System.Collections.Generic.List Dimension { get => this._dimension; set => this._dimension = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods _failingPeriod; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods _failingPeriod; /// /// The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant /// only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods FailingPeriod { get => (this._failingPeriod = this._failingPeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriods()); set => this._failingPeriod = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods FailingPeriod { get => (this._failingPeriod = this._failingPeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriods()); set => this._failingPeriod = value; } /// /// The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is /// 1 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public long? FailingPeriodMinFailingPeriodsToAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)FailingPeriod).MinFailingPeriodsToAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)FailingPeriod).MinFailingPeriodsToAlert = value ?? default(long); } + public long? FailingPeriodMinFailingPeriodsToAlert { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)FailingPeriod).MinFailingPeriodsToAlert; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)FailingPeriod).MinFailingPeriodsToAlert = value ?? default(long); } /// /// The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity /// (windowSize) and the selected number of aggregated points. Default value is 1 /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public long? FailingPeriodNumberOfEvaluationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)FailingPeriod).NumberOfEvaluationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)FailingPeriod).NumberOfEvaluationPeriod = value ?? default(long); } + public long? FailingPeriodNumberOfEvaluationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)FailingPeriod).NumberOfEvaluationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)FailingPeriod).NumberOfEvaluationPeriod = value ?? default(long); } /// Backing field for property. private string _metricMeasureColumn; @@ -63,16 +63,16 @@ public partial class Condition : public string MetricName { get => this._metricName; set => this._metricName = value; } /// Internal Acessors for FailingPeriod - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionInternal.FailingPeriod { get => (this._failingPeriod = this._failingPeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriods()); set { {_failingPeriod = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionInternal.FailingPeriod { get => (this._failingPeriod = this._failingPeriod ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriods()); set { {_failingPeriod = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator? _operator; + private string _operator; /// /// The criteria operator. Relevant and required only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator? Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. private string _query; @@ -101,11 +101,11 @@ public partial class Condition : public double? Threshold { get => this._threshold; set => this._threshold = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation? _timeAggregation; + private string _timeAggregation; /// Aggregation type. Relevant and required only for rules of the kind LogAlert. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation? TimeAggregation { get => this._timeAggregation; set => this._timeAggregation = value; } + public string TimeAggregation { get => this._timeAggregation; set => this._timeAggregation = value; } /// Creates an new instance. public Condition() @@ -121,10 +121,13 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Dimensions conditions", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[] Dimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension) })] + System.Collections.Generic.List Dimension { get; set; } /// /// The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is /// 1 @@ -132,6 +135,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1", SerializedName = @"minFailingPeriodsToAlert", PossibleTypes = new [] { typeof(long) })] @@ -143,6 +149,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1", SerializedName = @"numberOfEvaluationPeriods", PossibleTypes = new [] { typeof(long) })] @@ -153,6 +162,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The column containing the metric measure number. Relevant only for rules of the kind LogAlert.", SerializedName = @"metricMeasureColumn", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +175,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric.", SerializedName = @"metricName", PossibleTypes = new [] { typeof(string) })] @@ -173,14 +188,21 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The criteria operator. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator? Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string Operator { get; set; } /// Log query alert [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Log query alert", SerializedName = @"query", PossibleTypes = new [] { typeof(string) })] @@ -192,6 +214,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only for rules of the kind LogAlert.", SerializedName = @"resourceIdColumn", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +227,9 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"threshold", PossibleTypes = new [] { typeof(double) })] @@ -210,10 +238,14 @@ public partial interface ICondition : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Aggregation type. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"timeAggregation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation? TimeAggregation { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Count", "Average", "Minimum", "Maximum", "Total")] + string TimeAggregation { get; set; } } /// A condition of the scheduled query rule. @@ -221,12 +253,12 @@ internal partial interface IConditionInternal { /// List of Dimensions conditions - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension[] Dimension { get; set; } + System.Collections.Generic.List Dimension { get; set; } /// /// The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant /// only for rules of the kind LogAlert. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods FailingPeriod { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods FailingPeriod { get; set; } /// /// The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is /// 1 @@ -248,7 +280,8 @@ internal partial interface IConditionInternal /// /// The criteria operator. Relevant and required only for rules of the kind LogAlert. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator? Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Equals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + string Operator { get; set; } /// Log query alert string Query { get; set; } /// @@ -261,7 +294,8 @@ internal partial interface IConditionInternal /// double? Threshold { get; set; } /// Aggregation type. Relevant and required only for rules of the kind LogAlert. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation? TimeAggregation { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Count", "Average", "Minimum", "Maximum", "Total")] + string TimeAggregation { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.json.cs similarity index 91% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.json.cs index 0d1dd5f99a7d..37d853994923 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Condition.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Condition.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -65,26 +65,26 @@ internal Condition(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule { return; } - {_failingPeriod = If( json?.PropertyT("failingPeriods"), out var __jsonFailingPeriods) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionFailingPeriods.FromJson(__jsonFailingPeriods) : FailingPeriod;} - {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? (string)__jsonQuery : (string)Query;} - {_timeAggregation = If( json?.PropertyT("timeAggregation"), out var __jsonTimeAggregation) ? (string)__jsonTimeAggregation : (string)TimeAggregation;} - {_metricMeasureColumn = If( json?.PropertyT("metricMeasureColumn"), out var __jsonMetricMeasureColumn) ? (string)__jsonMetricMeasureColumn : (string)MetricMeasureColumn;} - {_resourceIdColumn = If( json?.PropertyT("resourceIdColumn"), out var __jsonResourceIdColumn) ? (string)__jsonResourceIdColumn : (string)ResourceIdColumn;} - {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Dimension.FromJson(__u) )) ))() : null : Dimension;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (double?)__jsonThreshold : Threshold;} - {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)MetricName;} + {_failingPeriod = If( json?.PropertyT("failingPeriods"), out var __jsonFailingPeriods) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionFailingPeriods.FromJson(__jsonFailingPeriods) : _failingPeriod;} + {_query = If( json?.PropertyT("query"), out var __jsonQuery) ? (string)__jsonQuery : (string)_query;} + {_timeAggregation = If( json?.PropertyT("timeAggregation"), out var __jsonTimeAggregation) ? (string)__jsonTimeAggregation : (string)_timeAggregation;} + {_metricMeasureColumn = If( json?.PropertyT("metricMeasureColumn"), out var __jsonMetricMeasureColumn) ? (string)__jsonMetricMeasureColumn : (string)_metricMeasureColumn;} + {_resourceIdColumn = If( json?.PropertyT("resourceIdColumn"), out var __jsonResourceIdColumn) ? (string)__jsonResourceIdColumn : (string)_resourceIdColumn;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Dimension.FromJson(__u) )) ))() : null : _dimension;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_threshold = If( json?.PropertyT("threshold"), out var __jsonThreshold) ? (double?)__jsonThreshold : _threshold;} + {_metricName = If( json?.PropertyT("metricName"), out var __jsonMetricName) ? (string)__jsonMetricName : (string)_metricName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new Condition(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.PowerShell.cs similarity index 77% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.PowerShell.cs index 251f9064a664..14e2ef4d9cf6 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class ConditionFailingPeriods 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. @@ -81,17 +81,17 @@ internal ConditionFailingPeriods(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NumberOfEvaluationPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod = (long?) content.GetValueForProperty("NumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod = (long?) content.GetValueForProperty("NumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("MinFailingPeriodsToAlert")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert = (long?) content.GetValueForProperty("MinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert = (long?) content.GetValueForProperty("MinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -106,39 +106,39 @@ internal ConditionFailingPeriods(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("NumberOfEvaluationPeriod")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod = (long?) content.GetValueForProperty("NumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod = (long?) content.GetValueForProperty("NumberOfEvaluationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).NumberOfEvaluationPeriod, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("MinFailingPeriodsToAlert")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert = (long?) content.GetValueForProperty("MinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert = (long?) content.GetValueForProperty("MinFailingPeriodsToAlert",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal)this).MinFailingPeriodsToAlert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } 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.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConditionFailingPeriods(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.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConditionFailingPeriods(content); } @@ -148,7 +148,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.TypeConverter.cs index e695a0cefe1a..c5cff75c491f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.cs similarity index 95% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.cs index 76cd5c699b0d..7873cfed7637 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.A /// only for rules of the kind LogAlert. /// public partial class ConditionFailingPeriods : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriodsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriodsInternal { /// Backing field for property. @@ -54,6 +54,9 @@ public partial interface IConditionFailingPeriods : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1", SerializedName = @"minFailingPeriodsToAlert", PossibleTypes = new [] { typeof(long) })] @@ -65,6 +68,9 @@ public partial interface IConditionFailingPeriods : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1", SerializedName = @"numberOfEvaluationPeriods", PossibleTypes = new [] { typeof(long) })] diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.json.cs similarity index 95% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.json.cs index 746fa3b4a40a..53846169cb3b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ConditionFailingPeriods.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ConditionFailingPeriods.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -68,19 +68,19 @@ internal ConditionFailingPeriods(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Sche { return; } - {_numberOfEvaluationPeriod = If( json?.PropertyT("numberOfEvaluationPeriods"), out var __jsonNumberOfEvaluationPeriods) ? (long?)__jsonNumberOfEvaluationPeriods : NumberOfEvaluationPeriod;} - {_minFailingPeriodsToAlert = If( json?.PropertyT("minFailingPeriodsToAlert"), out var __jsonMinFailingPeriodsToAlert) ? (long?)__jsonMinFailingPeriodsToAlert : MinFailingPeriodsToAlert;} + {_numberOfEvaluationPeriod = If( json?.PropertyT("numberOfEvaluationPeriods"), out var __jsonNumberOfEvaluationPeriods) ? (long?)__jsonNumberOfEvaluationPeriods : _numberOfEvaluationPeriod;} + {_minFailingPeriodsToAlert = If( json?.PropertyT("minFailingPeriodsToAlert"), out var __jsonMinFailingPeriodsToAlert) ? (long?)__jsonMinFailingPeriodsToAlert : _minFailingPeriodsToAlert;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IConditionFailingPeriods FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IConditionFailingPeriods FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ConditionFailingPeriods(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.PowerShell.cs similarity index 73% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.PowerShell.cs index ff91b52089c6..b60d6cf21e59 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class Dimension 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.ScheduledQueryRule.Models.Api20210801.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Dimension(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.ScheduledQueryRule.Models.Api20210801.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Dimension(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,21 +104,21 @@ internal Dimension(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, 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,15 +133,15 @@ internal Dimension(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Operator")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Operator = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Operator, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Operator, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -153,7 +151,7 @@ internal Dimension(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.ScheduledQueryRule.Models.Api20210801.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.TypeConverter.cs index 053a213072e4..b4871dca6f80 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IDimension ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.cs similarity index 75% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.cs index 69ed3a85b13b..8aa3f9805216 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Dimension splitting and filtering definition public partial class Dimension : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimensionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimensionInternal { /// Backing field for property. @@ -21,18 +21,18 @@ public partial class Dimension : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator _operator; + private string _operator; /// Operator for dimension values [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator Operator { get => this._operator; set => this._operator = value; } + public string Operator { get => this._operator; set => this._operator = value; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; /// List of dimension values [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public string[] 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 Dimension() @@ -48,6 +48,9 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the dimension", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -56,18 +59,25 @@ public partial interface IDimension : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operator for dimension values", SerializedName = @"operator", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator Operator { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Include", "Exclude")] + string Operator { get; set; } /// List of dimension values [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of dimension values", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// Dimension splitting and filtering definition @@ -77,9 +87,10 @@ internal partial interface IDimensionInternal /// Name of the dimension string Name { get; set; } /// Operator for dimension values - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator Operator { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("Include", "Exclude")] + string Operator { get; set; } /// List of dimension values - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.json.cs similarity index 92% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.json.cs index c6a47604af1a..ed0ec49d710d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/Dimension.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Dimension.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -65,20 +65,20 @@ internal Dimension(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)Operator;} - {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operator = If( json?.PropertyT("operator"), out var __jsonOperator) ? (string)__jsonOperator : (string)_operator;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new Dimension(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 77% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index 0c8cf3c4b3dd..91fbe1d47216 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index 9dd4ade57855..b611a59ca3a7 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 87% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 0f3a15476c6e..0434237c2704 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 94% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index 9037c4186369..1171c8b89792 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Schedule { 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.PowerShell.cs similarity index 61% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.PowerShell.cs index 423dfd5e58a7..34af9718abf8 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ErrorContract 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.ScheduledQueryRule.Models.Api20210801.IErrorContract DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorContract(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.ScheduledQueryRule.Models.Api20210801.IErrorContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorContract(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,33 +104,33 @@ internal ErrorContract(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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. @@ -147,27 +145,27 @@ internal ErrorContract(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -177,7 +175,7 @@ internal ErrorContract(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.ScheduledQueryRule.Models.Api20210801.IErrorContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.TypeConverter.cs index 9c08384cf96c..cced418f9e06 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IErrorContract ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.cs similarity index 57% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.cs index c22f61d20f19..700b2bffbda2 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.cs @@ -3,60 +3,60 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Describes the format of Error response. public partial class ErrorContract : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).AdditionalInfo; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Code; } /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse _error; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse _error; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).AdditionalInfo = value ?? null /* arrayOf */; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Code = value ?? null; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Detail = value ?? null /* arrayOf */; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Message = value ?? null; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContractInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContractInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Target = value ?? null; } /// The error target. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)Error).Target; } /// Creates an new instance. public ErrorContract() @@ -72,14 +72,20 @@ public partial interface IErrorContract : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -88,14 +94,20 @@ public partial interface IErrorContract : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +116,9 @@ public partial interface IErrorContract : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -115,13 +130,13 @@ internal partial interface IErrorContractInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.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.ScheduledQueryRule.Models.Api10.IErrorResponse[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse Error { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.json.cs similarity index 94% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.json.cs index 01a63acd98b1..a9e122fcf036 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ErrorContract.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorContract.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ErrorContract(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQuery { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ErrorContract(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 66% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index cca6b803e474..503c9774dd20 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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,29 +107,29 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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. @@ -144,23 +144,23 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponseTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -170,7 +170,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.ScheduledQueryRule.Models.Api10.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 95559cf1d4e7..48e9ce8f16d4 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.cs similarity index 68% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.cs index 37d703034495..e6272263462f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -12,16 +12,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.A /// the OData error response format.) /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } /// Backing field for property. private string _code; @@ -31,11 +31,11 @@ public partial class ErrorResponse : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -45,19 +45,19 @@ public partial class ErrorResponse : public string Message { get => this._message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponseInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponseInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -81,14 +81,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -97,14 +103,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +125,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -125,11 +140,11 @@ internal partial interface IErrorResponseInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.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.ScheduledQueryRule.Models.Api10.IErrorResponse[] 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/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 88% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ErrorResponse.json.cs index 088b302aa18b..3e3eb33e36bd 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -68,22 +68,22 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQuery { 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorResponse) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ErrorResponse.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorResponse) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorResponse.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } @@ -107,19 +107,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -131,7 +131,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 78% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.PowerShell.cs index 755321298999..c70a284cb3e9 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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,21 +113,21 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)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. @@ -142,15 +142,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.TypeConverter.cs index f0797fba8657..b73b683b46b1 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.cs similarity index 90% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.cs index df0a6835a30e..4f7037d48fea 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.A /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal { /// Backing field for property. @@ -25,13 +25,13 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -65,6 +65,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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) })] @@ -73,6 +76,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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) })] diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Resource.json.cs index bf9bf974d4c1..da382a6f5748 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/Resource.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,9 +79,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule. { return; } - {_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;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.PowerShell.cs similarity index 78% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.PowerShell.cs index f33cbaabf589..6f639dcc9bdb 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class ScheduledQueryRuleCriteria 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScheduledQueryRuleCriteria(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScheduledQueryRuleCriteria(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +113,13 @@ internal ScheduledQueryRuleCriteria(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.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. @@ -134,7 +134,7 @@ internal ScheduledQueryRuleCriteria(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("AllOf")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)this).AllOf = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[]) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)this).AllOf, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ConditionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)this).AllOf = (System.Collections.Generic.List) content.GetValueForProperty("AllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)this).AllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.TypeConverter.cs index 3e2d9f590318..8295ff9b375a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.cs similarity index 72% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.cs index ab057ee91256..4b299d5522cc 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// The rule criteria that defines the conditions of the scheduled query rule. public partial class ScheduledQueryRuleCriteria : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] _allOf; + private System.Collections.Generic.List _allOf; /// A list of conditions to evaluate against the specified scopes [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] AllOf { get => this._allOf; set => this._allOf = value; } + public System.Collections.Generic.List AllOf { get => this._allOf; set => this._allOf = value; } /// Creates an new instance. public ScheduledQueryRuleCriteria() @@ -34,10 +34,13 @@ public partial interface IScheduledQueryRuleCriteria : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] AllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + System.Collections.Generic.List AllOf { get; set; } } /// The rule criteria that defines the conditions of the scheduled query rule. @@ -45,7 +48,7 @@ internal partial interface IScheduledQueryRuleCriteriaInternal { /// A list of conditions to evaluate against the specified scopes - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] AllOf { get; set; } + System.Collections.Generic.List AllOf { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.json.cs similarity index 90% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.json.cs index a933f44b29c6..2d5fcf43c43a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleCriteria.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleCriteria.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleCriteria partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleCriteria(json) : null; } @@ -77,7 +77,7 @@ internal ScheduledQueryRuleCriteria(Microsoft.Azure.PowerShell.Cmdlets.Monitor.S { return; } - {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.ICondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Condition.FromJson(__u) )) ))() : null : AllOf;} + {_allOf = If( json?.PropertyT("allOf"), out var __jsonAllOf) ? If( __jsonAllOf as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.ICondition) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Condition.FromJson(__u) )) ))() : null : _allOf;} AfterFromJson(json); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.cs index 273ea49fe963..304eff2bf981 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.cs @@ -53,6 +53,9 @@ public partial interface IScheduledQueryRuleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IScheduledQueryRuleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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) })] @@ -69,6 +75,9 @@ public partial interface IScheduledQueryRuleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the rule.", SerializedName = @"ruleName", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IScheduledQueryRuleIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.json.cs index dd0cab5101ca..7d140c741183 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleIdentity.json.cs @@ -76,10 +76,10 @@ internal ScheduledQueryRuleIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.S { 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;} - {_ruleName = If( json?.PropertyT("ruleName"), out var __jsonRuleName) ? (string)__jsonRuleName : (string)RuleName;} - {_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;} + {_ruleName = If( json?.PropertyT("ruleName"), out var __jsonRuleName) ? (string)__jsonRuleName : (string)_ruleName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.PowerShell.cs new file mode 100644 index 000000000000..bb614a1f5e88 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.PowerShell.cs @@ -0,0 +1,326 @@ +// 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.ScheduledQueryRule.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + + /// scheduled query rule Definition + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRulePropertiesTypeConverter))] + public partial class ScheduledQueryRuleProperties + { + + /// + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScheduledQueryRuleProperties(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.ScheduledQueryRule.Models.IScheduledQueryRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScheduledQueryRuleProperties(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.ScheduledQueryRule.Models.IScheduledQueryRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScheduledQueryRuleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ScheduledQueryRuleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + 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.ScheduledQueryRule.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(); + } + } + /// scheduled query rule Definition + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRulePropertiesTypeConverter))] + public partial interface IScheduledQueryRuleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.TypeConverter.cs index 586a003c7abc..ba9e93651fd5 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.cs similarity index 83% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.cs index d683ba792998..fb26a25d7d93 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.cs @@ -3,30 +3,30 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// scheduled query rule Definition public partial class ScheduledQueryRuleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions _action; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions _action; /// Actions to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Actions()); set => this._action = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Actions()); set => this._action = value; } /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)Action).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)Action).CustomProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)Action).CustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)Action).CustomProperty = value ?? null /* model class */; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsInternal)Action).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)Action).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsInternal)Action).ActionGroup = value ?? null /* arrayOf */; } /// Backing field for property. private bool? _autoMitigate; @@ -58,15 +58,15 @@ public partial class ScheduledQueryRuleProperties : public string CreatedWithApiVersion { get => this._createdWithApiVersion; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria _criterion; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria _criterion; /// The rule criteria that defines the conditions of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Criterion { get => (this._criterion = this._criterion ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteria()); set => this._criterion = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Criterion { get => (this._criterion = this._criterion ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteria()); set => this._criterion = value; } /// A list of conditions to evaluate against the specified scopes [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)Criterion).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteriaInternal)Criterion).AllOf = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)Criterion).AllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteriaInternal)Criterion).AllOf = value ?? null /* arrayOf */; } /// Backing field for property. private string _description; @@ -119,19 +119,19 @@ public partial class ScheduledQueryRuleProperties : public bool? IsWorkspaceAlertsStorageConfigured { get => this._isWorkspaceAlertsStorageConfigured; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Actions()); set { {_action = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal.Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Actions()); set { {_action = value;} } } /// Internal Acessors for CreatedWithApiVersion - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal.CreatedWithApiVersion { get => this._createdWithApiVersion; set { {_createdWithApiVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal.CreatedWithApiVersion { get => this._createdWithApiVersion; set { {_createdWithApiVersion = value;} } } /// Internal Acessors for Criterion - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal.Criterion { get => (this._criterion = this._criterion ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteria()); set { {_criterion = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal.Criterion { get => (this._criterion = this._criterion ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteria()); set { {_criterion = value;} } } /// Internal Acessors for IsLegacyLogAnalyticsRule - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal.IsLegacyLogAnalyticsRule { get => this._isLegacyLogAnalyticsRule; set { {_isLegacyLogAnalyticsRule = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal.IsLegacyLogAnalyticsRule { get => this._isLegacyLogAnalyticsRule; set { {_isLegacyLogAnalyticsRule = value;} } } /// Internal Acessors for IsWorkspaceAlertsStorageConfigured - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal.IsWorkspaceAlertsStorageConfigured { get => this._isWorkspaceAlertsStorageConfigured; set { {_isWorkspaceAlertsStorageConfigured = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal.IsWorkspaceAlertsStorageConfigured { get => this._isWorkspaceAlertsStorageConfigured; set { {_isWorkspaceAlertsStorageConfigured = value;} } } /// Backing field for property. private global::System.TimeSpan? _muteActionsDuration; @@ -154,11 +154,11 @@ public partial class ScheduledQueryRuleProperties : public global::System.TimeSpan? OverrideQueryTimeRange { get => this._overrideQueryTimeRange; set => this._overrideQueryTimeRange = value; } /// Backing field for property. - private string[] _scope; + private System.Collections.Generic.List _scope; /// The list of resource id's that this scheduled query rule is scoped to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public string[] Scope { get => this._scope; set => this._scope = value; } + public System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } /// Backing field for property. private long? _severity; @@ -181,7 +181,7 @@ public partial class ScheduledQueryRuleProperties : public bool? SkipQueryValidation { get => this._skipQueryValidation; set => this._skipQueryValidation = value; } /// Backing field for property. - private string[] _targetResourceType; + private System.Collections.Generic.List _targetResourceType; /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -189,7 +189,7 @@ public partial class ScheduledQueryRuleProperties : /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public string[] TargetResourceType { get => this._targetResourceType; set => this._targetResourceType = value; } + public System.Collections.Generic.List TargetResourceType { get => this._targetResourceType; set => this._targetResourceType = value; } /// Backing field for property. private global::System.TimeSpan? _windowSize; @@ -215,18 +215,24 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -234,6 +240,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.", SerializedName = @"autoMitigate", PossibleTypes = new [] { typeof(bool) })] @@ -245,6 +254,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"checkWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -253,6 +265,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The api-version used when creating this alert rule", SerializedName = @"createdWithApiVersion", PossibleTypes = new [] { typeof(string) })] @@ -261,14 +276,20 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the scheduled query rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -277,6 +298,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of the alert rule", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +311,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule is enabled. Value should be true or false", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -298,6 +325,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"evaluationFrequency", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -306,6 +336,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"True if alert rule is legacy Log Analytic rule", SerializedName = @"isLegacyLogAnalyticsRule", PossibleTypes = new [] { typeof(bool) })] @@ -317,6 +350,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.", SerializedName = @"isWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -328,6 +364,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.", SerializedName = @"muteActionsDuration", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -339,6 +378,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.", SerializedName = @"overrideQueryTimeRange", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -347,10 +389,13 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -358,6 +403,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"severity", PossibleTypes = new [] { typeof(long) })] @@ -369,6 +417,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"skipQueryValidation", PossibleTypes = new [] { typeof(bool) })] @@ -381,10 +432,13 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. @@ -392,6 +446,9 @@ public partial interface IScheduledQueryRuleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.", SerializedName = @"windowSize", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -403,11 +460,11 @@ internal partial interface IScheduledQueryRulePropertiesInternal { /// Actions to invoke when the alert fires. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Action { get; set; } /// The properties of an alert payload. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -421,9 +478,9 @@ internal partial interface IScheduledQueryRulePropertiesInternal /// The api-version used when creating this alert rule string CreatedWithApiVersion { get; set; } /// The rule criteria that defines the conditions of the scheduled query rule. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Criterion { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Criterion { get; set; } /// A list of conditions to evaluate against the specified scopes - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. string Description { get; set; } /// The display name of the alert rule @@ -455,7 +512,7 @@ internal partial interface IScheduledQueryRulePropertiesInternal /// global::System.TimeSpan? OverrideQueryTimeRange { get; set; } /// The list of resource id's that this scheduled query rule is scoped to. - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -471,7 +528,7 @@ internal partial interface IScheduledQueryRulePropertiesInternal /// group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.json.cs similarity index 90% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.json.cs index 225db0d314c5..cfe4c80a75a2 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleProperties.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleProperties.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleProperties(json) : null; } @@ -77,24 +77,24 @@ internal ScheduledQueryRuleProperties(Microsoft.Azure.PowerShell.Cmdlets.Monitor { return; } - {_criterion = If( json?.PropertyT("criteria"), out var __jsonCriteria) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleCriteria.FromJson(__jsonCriteria) : Criterion;} - {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.Actions.FromJson(__jsonActions) : Action;} - {_createdWithApiVersion = If( json?.PropertyT("createdWithApiVersion"), out var __jsonCreatedWithApiVersion) ? (string)__jsonCreatedWithApiVersion : (string)CreatedWithApiVersion;} - {_isLegacyLogAnalyticsRule = If( json?.PropertyT("isLegacyLogAnalyticsRule"), out var __jsonIsLegacyLogAnalyticsRule) ? (bool?)__jsonIsLegacyLogAnalyticsRule : IsLegacyLogAnalyticsRule;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (long?)__jsonSeverity : Severity;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Scope;} - {_evaluationFrequency = If( json?.PropertyT("evaluationFrequency"), out var __jsonEvaluationFrequency) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonEvaluationFrequency ) : EvaluationFrequency;} - {_windowSize = If( json?.PropertyT("windowSize"), out var __jsonWindowSize) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonWindowSize ) : WindowSize;} - {_overrideQueryTimeRange = If( json?.PropertyT("overrideQueryTimeRange"), out var __jsonOverrideQueryTimeRange) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonOverrideQueryTimeRange ) : OverrideQueryTimeRange;} - {_targetResourceType = If( json?.PropertyT("targetResourceTypes"), out var __jsonTargetResourceTypes) ? If( __jsonTargetResourceTypes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : TargetResourceType;} - {_muteActionsDuration = If( json?.PropertyT("muteActionsDuration"), out var __jsonMuteActionsDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonMuteActionsDuration ) : MuteActionsDuration;} - {_isWorkspaceAlertsStorageConfigured = If( json?.PropertyT("isWorkspaceAlertsStorageConfigured"), out var __jsonIsWorkspaceAlertsStorageConfigured) ? (bool?)__jsonIsWorkspaceAlertsStorageConfigured : IsWorkspaceAlertsStorageConfigured;} - {_checkWorkspaceAlertsStorageConfigured = If( json?.PropertyT("checkWorkspaceAlertsStorageConfigured"), out var __jsonCheckWorkspaceAlertsStorageConfigured) ? (bool?)__jsonCheckWorkspaceAlertsStorageConfigured : CheckWorkspaceAlertsStorageConfigured;} - {_skipQueryValidation = If( json?.PropertyT("skipQueryValidation"), out var __jsonSkipQueryValidation) ? (bool?)__jsonSkipQueryValidation : SkipQueryValidation;} - {_autoMitigate = If( json?.PropertyT("autoMitigate"), out var __jsonAutoMitigate) ? (bool?)__jsonAutoMitigate : AutoMitigate;} + {_criterion = If( json?.PropertyT("criteria"), out var __jsonCriteria) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteria.FromJson(__jsonCriteria) : _criterion;} + {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Actions.FromJson(__jsonActions) : _action;} + {_createdWithApiVersion = If( json?.PropertyT("createdWithApiVersion"), out var __jsonCreatedWithApiVersion) ? (string)__jsonCreatedWithApiVersion : (string)_createdWithApiVersion;} + {_isLegacyLogAnalyticsRule = If( json?.PropertyT("isLegacyLogAnalyticsRule"), out var __jsonIsLegacyLogAnalyticsRule) ? (bool?)__jsonIsLegacyLogAnalyticsRule : _isLegacyLogAnalyticsRule;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_severity = If( json?.PropertyT("severity"), out var __jsonSeverity) ? (long?)__jsonSeverity : _severity;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : _enabled;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _scope;} + {_evaluationFrequency = If( json?.PropertyT("evaluationFrequency"), out var __jsonEvaluationFrequency) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonEvaluationFrequency ) : _evaluationFrequency;} + {_windowSize = If( json?.PropertyT("windowSize"), out var __jsonWindowSize) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonWindowSize ) : _windowSize;} + {_overrideQueryTimeRange = If( json?.PropertyT("overrideQueryTimeRange"), out var __jsonOverrideQueryTimeRange) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonOverrideQueryTimeRange ) : _overrideQueryTimeRange;} + {_targetResourceType = If( json?.PropertyT("targetResourceTypes"), out var __jsonTargetResourceTypes) ? If( __jsonTargetResourceTypes as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _targetResourceType;} + {_muteActionsDuration = If( json?.PropertyT("muteActionsDuration"), out var __jsonMuteActionsDuration) ? global::System.Xml.XmlConvert.ToTimeSpan( __jsonMuteActionsDuration ) : _muteActionsDuration;} + {_isWorkspaceAlertsStorageConfigured = If( json?.PropertyT("isWorkspaceAlertsStorageConfigured"), out var __jsonIsWorkspaceAlertsStorageConfigured) ? (bool?)__jsonIsWorkspaceAlertsStorageConfigured : _isWorkspaceAlertsStorageConfigured;} + {_checkWorkspaceAlertsStorageConfigured = If( json?.PropertyT("checkWorkspaceAlertsStorageConfigured"), out var __jsonCheckWorkspaceAlertsStorageConfigured) ? (bool?)__jsonCheckWorkspaceAlertsStorageConfigured : _checkWorkspaceAlertsStorageConfigured;} + {_skipQueryValidation = If( json?.PropertyT("skipQueryValidation"), out var __jsonSkipQueryValidation) ? (bool?)__jsonSkipQueryValidation : _skipQueryValidation;} + {_autoMitigate = If( json?.PropertyT("autoMitigate"), out var __jsonAutoMitigate) ? (bool?)__jsonAutoMitigate : _autoMitigate;} AfterFromJson(json); } @@ -119,11 +119,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso } AddIf( null != this._criterion ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._criterion.ToJson(null,serializationMode) : null, "criteria" ,container.Add ); AddIf( null != this._action ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._action.ToJson(null,serializationMode) : null, "actions" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._createdWithApiVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._createdWithApiVersion.ToString()) : null, "createdWithApiVersion" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isLegacyLogAnalyticsRule ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonBoolean((bool)this._isLegacyLogAnalyticsRule) : null, "isLegacyLogAnalyticsRule" ,container.Add ); } @@ -153,7 +153,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso container.Add("targetResourceTypes",__r); } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode)(null != this._muteActionsDuration ? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(global::System.Xml.XmlConvert.ToString((global::System.TimeSpan)this._muteActionsDuration)): null), "muteActionsDuration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isWorkspaceAlertsStorageConfigured ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonBoolean((bool)this._isWorkspaceAlertsStorageConfigured) : null, "isWorkspaceAlertsStorageConfigured" ,container.Add ); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.PowerShell.cs new file mode 100644 index 000000000000..ac6d9b90fe36 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.PowerShell.cs @@ -0,0 +1,446 @@ +// 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.ScheduledQueryRule.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + + /// The scheduled query rule resource. + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourceTypeConverter))] + public partial class ScheduledQueryRuleResource + { + + /// + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScheduledQueryRuleResource(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.ScheduledQueryRule.Models.IScheduledQueryRuleResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScheduledQueryRuleResource(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.ScheduledQueryRule.Models.IScheduledQueryRuleResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScheduledQueryRuleResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)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("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)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("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ScheduledQueryRuleResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)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("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)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("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + 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.ScheduledQueryRule.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 scheduled query rule resource. + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourceTypeConverter))] + public partial interface IScheduledQueryRuleResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.TypeConverter.cs index 3a41036d9f7c..7972d09afa54 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.cs similarity index 65% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.cs index 8d02ac7957a2..af4b4d4b3048 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.cs @@ -3,65 +3,65 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// The scheduled query rule resource. public partial class ScheduledQueryRuleResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResource(); /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty = value ?? null /* model class */; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? AutoMitigate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate = value ?? default(bool); } + public bool? AutoMitigate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate = value ?? default(bool); } /// /// The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is /// false. Relevant only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? CheckWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured = value ?? default(bool); } + public bool? CheckWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured = value ?? default(bool); } /// The api-version used when creating this alert rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; } + public string CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; } /// A list of conditions to evaluate against the specified scopes [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf = value ?? null /* arrayOf */; } /// The description of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Description = value ?? null; } /// The display name of the alert rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).DisplayName = value ?? null; } /// /// The flag which indicates whether this scheduled query rule is enabled. Value should be true or false /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Enabled = value ?? default(bool); } /// Backing field for property. private string _etag; @@ -80,146 +80,168 @@ public partial class ScheduledQueryRuleResource : /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? EvaluationFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? EvaluationFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency = value ?? default(global::System.TimeSpan); } /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Id; } /// True if alert rule is legacy Log Analytic rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; } + public bool? IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; } /// /// The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. /// The default is false. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; } + public bool? IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind? _kind; + private string _kind; /// Indicates the type of scheduled query rule. The default is LogAlert. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)__trackedResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Type = value ?? null; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Action = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Action = value ?? null /* model class */; } /// Internal Acessors for CreatedWithApiVersion - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion = value ?? null; } /// Internal Acessors for Criterion - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.Criterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Criterion = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.Criterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Criterion = value ?? null /* model class */; } /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } /// Internal Acessors for IsLegacyLogAnalyticsRule - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule = value ?? default(bool); } /// Internal Acessors for IsWorkspaceAlertsStorageConfigured - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured = value ?? default(bool); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// /// Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules /// of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? MuteActionsDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? MuteActionsDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration = value ?? default(global::System.TimeSpan); } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Name; } /// /// If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? OverrideQueryTimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? OverrideQueryTimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange = value ?? default(global::System.TimeSpan); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties _property; /// The rule properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties()); set => this._property = value; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// The list of resource id's that this scheduled query rule is scoped to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public long? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Severity = value ?? default(long); } + public long? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Severity = value ?? default(long); } /// /// The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? SkipQueryValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation = value ?? default(bool); } + public bool? SkipQueryValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData _systemData; /// SystemData of ScheduledQueryRule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -227,20 +249,20 @@ public partial class ScheduledQueryRuleResource : /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] TargetResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType = value ?? null /* arrayOf */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__trackedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__trackedResource).Type; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? WindowSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).WindowSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).WindowSize = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? WindowSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).WindowSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).WindowSize = value ?? default(global::System.TimeSpan); } /// Creates an new instance. public ScheduledQueryRuleResource() @@ -263,24 +285,30 @@ public ScheduledQueryRuleResource() /// The scheduled query rule resource. public partial interface IScheduledQueryRuleResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource { /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -288,6 +316,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.", SerializedName = @"autoMitigate", PossibleTypes = new [] { typeof(bool) })] @@ -299,6 +330,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"checkWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -307,6 +341,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The api-version used when creating this alert rule", SerializedName = @"createdWithApiVersion", PossibleTypes = new [] { typeof(string) })] @@ -315,14 +352,20 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the scheduled query rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -331,6 +374,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of the alert rule", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -341,6 +387,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule is enabled. Value should be true or false", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -354,6 +403,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. ", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -365,6 +417,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"evaluationFrequency", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -373,6 +428,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"True if alert rule is legacy Log Analytic rule", SerializedName = @"isLegacyLogAnalyticsRule", PossibleTypes = new [] { typeof(bool) })] @@ -384,6 +442,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.", SerializedName = @"isWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -392,10 +453,14 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates the type of scheduled query rule. The default is LogAlert.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("LogAlert", "LogToMetric")] + string Kind { get; set; } /// /// Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules /// of the kind LogAlert. @@ -403,6 +468,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.", SerializedName = @"muteActionsDuration", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -414,6 +482,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.", SerializedName = @"overrideQueryTimeRange", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -422,10 +493,13 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -433,6 +507,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"severity", PossibleTypes = new [] { typeof(long) })] @@ -444,6 +521,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"skipQueryValidation", PossibleTypes = new [] { typeof(bool) })] @@ -451,51 +531,71 @@ public partial interface IScheduledQueryRuleResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource /// group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual @@ -504,10 +604,13 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. @@ -515,6 +618,9 @@ public partial interface IScheduledQueryRuleResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.", SerializedName = @"windowSize", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -523,14 +629,14 @@ public partial interface IScheduledQueryRuleResource : } /// The scheduled query rule resource. internal partial interface IScheduledQueryRuleResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal { /// Actions to invoke when the alert fires. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Action { get; set; } /// The properties of an alert payload. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -544,9 +650,9 @@ internal partial interface IScheduledQueryRuleResourceInternal : /// The api-version used when creating this alert rule string CreatedWithApiVersion { get; set; } /// The rule criteria that defines the conditions of the scheduled query rule. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Criterion { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Criterion { get; set; } /// A list of conditions to evaluate against the specified scopes - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. string Description { get; set; } /// The display name of the alert rule @@ -575,7 +681,8 @@ internal partial interface IScheduledQueryRuleResourceInternal : /// bool? IsWorkspaceAlertsStorageConfigured { get; set; } /// Indicates the type of scheduled query rule. The default is LogAlert. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("LogAlert", "LogToMetric")] + string Kind { get; set; } /// /// Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules /// of the kind LogAlert. @@ -587,9 +694,9 @@ internal partial interface IScheduledQueryRuleResourceInternal : /// global::System.TimeSpan? OverrideQueryTimeRange { get; set; } /// The rule properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Property { get; set; } /// The list of resource id's that this scheduled query rule is scoped to. - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -601,25 +708,27 @@ internal partial interface IScheduledQueryRuleResourceInternal : /// bool? SkipQueryValidation { get; set; } /// SystemData of ScheduledQueryRule. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource /// group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.json.cs similarity index 91% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.json.cs index d4e3a9bddc0a..ba0964b50756 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResource.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResource.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleResource(json) : null; } @@ -77,11 +77,11 @@ internal ScheduledQueryRuleResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.S { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResource(json); - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties.FromJson(__jsonProperties) : Property;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResource(json); + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties.FromJson(__jsonProperties) : _property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -105,13 +105,13 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso return container; } __trackedResource?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.PowerShell.cs similarity index 72% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.PowerShell.cs index 84a1ed857540..1f824e56da5d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class ScheduledQueryRuleResourceCollection 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScheduledQueryRuleResourceCollection(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScheduledQueryRuleResourceCollection(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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,17 +115,17 @@ internal ScheduledQueryRuleResourceCollection(global::System.Collections.IDictio // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)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. @@ -140,11 +140,11 @@ internal ScheduledQueryRuleResourceCollection(global::System.Management.Automati // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.TypeConverter.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.TypeConverter.cs index 33172d7105d2..fa14d2f95526 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.cs similarity index 74% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.cs index 8262cf281ecc..da324cb1fcfa 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.cs @@ -3,18 +3,18 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Represents a collection of scheduled query rule resources. public partial class ScheduledQueryRuleResourceCollection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollectionInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Backing field for property. private string _nextLink; @@ -24,11 +24,11 @@ public partial class ScheduledQueryRuleResourceCollection : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[] _value; + private System.Collections.Generic.List _value; /// The values for the scheduled query rule resources. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[] 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 ScheduledQueryRuleResourceCollection() @@ -44,6 +44,9 @@ public partial interface IScheduledQueryRuleResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Provides the link to retrieve the next set of elements.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IScheduledQueryRuleResourceCollection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The values for the scheduled query rule resources.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource) })] + System.Collections.Generic.List Value { get; set; } } /// Represents a collection of scheduled query rule resources. @@ -65,7 +71,7 @@ internal partial interface IScheduledQueryRuleResourceCollectionInternal /// Provides the link to retrieve the next set of elements. string NextLink { get; set; } /// The values for the scheduled query rule resources. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.json.cs similarity index 89% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.json.cs index 45c7eeea10e0..ee78c32098ac 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourceCollection.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourceCollection.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleResourceCollection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleResourceCollection(json) : null; } @@ -77,8 +77,8 @@ internal ScheduledQueryRuleResourceCollection(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource.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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -111,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.PowerShell.cs new file mode 100644 index 000000000000..52446807d578 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.PowerShell.cs @@ -0,0 +1,342 @@ +// 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.ScheduledQueryRule.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + + /// The scheduled query rule resource for patch operations. + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourcePatchTypeConverter))] + public partial class ScheduledQueryRuleResourcePatch + { + + /// + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ScheduledQueryRuleResourcePatch(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.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsTypeConverter.ConvertFrom); + } + if (content.Contains("Criterion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Criterion = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria) content.GetValueForProperty("Criterion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Criterion, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleCriteriaTypeConverter.ConvertFrom); + } + if (content.Contains("CreatedWithApiVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion = (string) content.GetValueForProperty("CreatedWithApiVersion",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CreatedWithApiVersion, global::System.Convert.ToString); + } + if (content.Contains("IsLegacyLogAnalyticsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule = (bool?) content.GetValueForProperty("IsLegacyLogAnalyticsRule",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsLegacyLogAnalyticsRule, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Severity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Severity = (long?) content.GetValueForProperty("Severity",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Severity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EvaluationFrequency")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency = (global::System.TimeSpan?) content.GetValueForProperty("EvaluationFrequency",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).EvaluationFrequency, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("WindowSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).WindowSize = (global::System.TimeSpan?) content.GetValueForProperty("WindowSize",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).WindowSize, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("OverrideQueryTimeRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange = (global::System.TimeSpan?) content.GetValueForProperty("OverrideQueryTimeRange",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).OverrideQueryTimeRange, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("TargetResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType = (System.Collections.Generic.List) content.GetValueForProperty("TargetResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).TargetResourceType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MuteActionsDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration = (global::System.TimeSpan?) content.GetValueForProperty("MuteActionsDuration",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).MuteActionsDuration, (v) => v is global::System.TimeSpan _v ? _v : global::System.Xml.XmlConvert.ToTimeSpan( v.ToString() )); + } + if (content.Contains("IsWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("IsWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).IsWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CheckWorkspaceAlertsStorageConfigured")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured = (bool?) content.GetValueForProperty("CheckWorkspaceAlertsStorageConfigured",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CheckWorkspaceAlertsStorageConfigured, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkipQueryValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation = (bool?) content.GetValueForProperty("SkipQueryValidation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).SkipQueryValidation, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutoMitigate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate = (bool?) content.GetValueForProperty("AutoMitigate",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).AutoMitigate, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActionGroup")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup = (System.Collections.Generic.List) content.GetValueForProperty("ActionGroup",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionGroup, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ActionCustomProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) content.GetValueForProperty("ActionCustomProperty",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).ActionCustomProperty, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ActionsCustomPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("CriterionAllOf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf = (System.Collections.Generic.List) content.GetValueForProperty("CriterionAllOf",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal)this).CriterionAllOf, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ConditionTypeConverter.ConvertFrom)); + } + 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.ScheduledQueryRule.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 scheduled query rule resource for patch operations. + [System.ComponentModel.TypeConverter(typeof(ScheduledQueryRuleResourcePatchTypeConverter))] + public partial interface IScheduledQueryRuleResourcePatch + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.TypeConverter.cs index 827a2f609a3d..79932bd9cac8 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.cs similarity index 70% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.cs index d39da5c3186a..7f2a5db5be5c 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.cs @@ -3,141 +3,141 @@ // Code generated by 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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// The scheduled query rule resource for patch operations. public partial class ScheduledQueryRuleResourcePatch : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal { /// The properties of an alert payload. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionCustomProperty = value ?? null /* model class */; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ActionGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).ActionGroup = value ?? null /* arrayOf */; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? AutoMitigate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate = value ?? default(bool); } + public bool? AutoMitigate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).AutoMitigate = value ?? default(bool); } /// /// The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is /// false. Relevant only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? CheckWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured = value ?? default(bool); } + public bool? CheckWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CheckWorkspaceAlertsStorageConfigured = value ?? default(bool); } /// The api-version used when creating this alert rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; } + public string CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; } /// A list of conditions to evaluate against the specified scopes [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf = value ?? null /* arrayOf */; } + public System.Collections.Generic.List CriterionAllOf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CriterionAllOf = value ?? null /* arrayOf */; } /// The description of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Description = value ?? null; } /// The display name of the alert rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).DisplayName = value ?? null; } /// /// The flag which indicates whether this scheduled query rule is enabled. Value should be true or false /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Enabled = value ?? default(bool); } + public bool? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Enabled = value ?? default(bool); } /// /// How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? EvaluationFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? EvaluationFrequency { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).EvaluationFrequency = value ?? default(global::System.TimeSpan); } /// True if alert rule is legacy Log Analytic rule [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; } + public bool? IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; } /// /// The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. /// The default is false. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; } + public bool? IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; } /// Internal Acessors for Action - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Action = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.Action { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Action = value ?? null /* model class */; } /// Internal Acessors for CreatedWithApiVersion - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.CreatedWithApiVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).CreatedWithApiVersion = value ?? null; } /// Internal Acessors for Criterion - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.Criterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Criterion = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.Criterion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Criterion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Criterion = value ?? null /* model class */; } /// Internal Acessors for IsLegacyLogAnalyticsRule - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.IsLegacyLogAnalyticsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsLegacyLogAnalyticsRule = value ?? default(bool); } /// Internal Acessors for IsWorkspaceAlertsStorageConfigured - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured = value; } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.IsWorkspaceAlertsStorageConfigured { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).IsWorkspaceAlertsStorageConfigured = value ?? default(bool); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties()); set { {_property = value;} } } /// /// Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules /// of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? MuteActionsDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? MuteActionsDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).MuteActionsDuration = value ?? default(global::System.TimeSpan); } /// /// If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? OverrideQueryTimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? OverrideQueryTimeRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).OverrideQueryTimeRange = value ?? default(global::System.TimeSpan); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties _property; /// The scheduled query rule properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties()); set => this._property = value; } /// The list of resource id's that this scheduled query rule is scoped to. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public long? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).Severity = value ?? default(long); } + public long? Severity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Severity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).Severity = value ?? default(long); } /// /// The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for /// rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public bool? SkipQueryValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation = value ?? default(bool); } + public bool? SkipQueryValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).SkipQueryValidation = value ?? default(bool); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTags()); set => this._tag = value; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -145,14 +145,14 @@ public partial class ScheduledQueryRuleResourcePatch : /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public string[] TargetResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).TargetResourceType = value ?? null /* arrayOf */; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inlined)] - public global::System.TimeSpan? WindowSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).WindowSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRulePropertiesInternal)Property).WindowSize = value ?? default(global::System.TimeSpan); } + public global::System.TimeSpan? WindowSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).WindowSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRulePropertiesInternal)Property).WindowSize = value ?? default(global::System.TimeSpan); } /// Creates an new instance. public ScheduledQueryRuleResourcePatch() @@ -168,18 +168,24 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -187,6 +193,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.", SerializedName = @"autoMitigate", PossibleTypes = new [] { typeof(bool) })] @@ -198,6 +207,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"checkWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -206,6 +218,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The api-version used when creating this alert rule", SerializedName = @"createdWithApiVersion", PossibleTypes = new [] { typeof(string) })] @@ -214,14 +229,20 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the scheduled query rule.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -230,6 +251,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of the alert rule", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +264,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether this scheduled query rule is enabled. Value should be true or false", SerializedName = @"enabled", PossibleTypes = new [] { typeof(bool) })] @@ -251,6 +278,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"evaluationFrequency", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -259,6 +289,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"True if alert rule is legacy Log Analytic rule", SerializedName = @"isLegacyLogAnalyticsRule", PossibleTypes = new [] { typeof(bool) })] @@ -270,6 +303,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.", SerializedName = @"isWorkspaceAlertsStorageConfigured", PossibleTypes = new [] { typeof(bool) })] @@ -281,6 +317,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.", SerializedName = @"muteActionsDuration", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -292,6 +331,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.", SerializedName = @"overrideQueryTimeRange", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -300,10 +342,13 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -311,6 +356,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.", SerializedName = @"severity", PossibleTypes = new [] { typeof(long) })] @@ -322,6 +370,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.", SerializedName = @"skipQueryValidation", PossibleTypes = new [] { typeof(bool) })] @@ -330,10 +381,13 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags Tag { get; set; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource /// group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual @@ -342,10 +396,13 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. @@ -353,6 +410,9 @@ public partial interface IScheduledQueryRuleResourcePatch : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.", SerializedName = @"windowSize", PossibleTypes = new [] { typeof(global::System.TimeSpan) })] @@ -364,11 +424,11 @@ internal partial interface IScheduledQueryRuleResourcePatchInternal { /// Actions to invoke when the alert fires. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActions Action { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActions Action { get; set; } /// The properties of an alert payload. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get; set; } /// Action Group resource Ids to invoke when the alert fires. - string[] ActionGroup { get; set; } + System.Collections.Generic.List ActionGroup { get; set; } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only /// for rules of the kind LogAlert. @@ -382,9 +442,9 @@ internal partial interface IScheduledQueryRuleResourcePatchInternal /// The api-version used when creating this alert rule string CreatedWithApiVersion { get; set; } /// The rule criteria that defines the conditions of the scheduled query rule. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleCriteria Criterion { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleCriteria Criterion { get; set; } /// A list of conditions to evaluate against the specified scopes - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get; set; } + System.Collections.Generic.List CriterionAllOf { get; set; } /// The description of the scheduled query rule. string Description { get; set; } /// The display name of the alert rule @@ -416,9 +476,9 @@ internal partial interface IScheduledQueryRuleResourcePatchInternal /// global::System.TimeSpan? OverrideQueryTimeRange { get; set; } /// The scheduled query rule properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleProperties Property { get; set; } /// The list of resource id's that this scheduled query rule is scoped to. - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules /// of the kind LogAlert. @@ -430,13 +490,13 @@ internal partial interface IScheduledQueryRuleResourcePatchInternal /// bool? SkipQueryValidation { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags Tag { get; set; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource /// group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual /// machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert /// - string[] TargetResourceType { get; set; } + System.Collections.Generic.List TargetResourceType { get; set; } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required /// only for rules of the kind LogAlert. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.json.cs similarity index 92% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.json.cs index c92a0f58d68a..f98b2dc7ae7f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatch.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatch.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleResourcePatch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleResourcePatch(json) : null; } @@ -77,8 +77,8 @@ internal ScheduledQueryRuleResourcePatch(Microsoft.Azure.PowerShell.Cmdlets.Moni { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.PowerShell.cs similarity index 87% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.PowerShell.cs index e2a16226da94..f80a7c0c5fbe 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class ScheduledQueryRuleResourcePatchTags 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScheduledQueryRuleResourcePatchTags(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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScheduledQueryRuleResourcePatchTags(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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. @@ -119,7 +119,7 @@ internal ScheduledQueryRuleResourcePatchTags(global::System.Collections.IDiction } /// - /// 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/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.TypeConverter.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.TypeConverter.cs index 25966d8d876f..27388903690e 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.cs similarity index 89% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.cs index 38ceb3ed06c2..2386ef921576 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Resource tags public partial class ScheduledQueryRuleResourcePatchTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.dictionary.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.dictionary.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.dictionary.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.dictionary.cs index a55d56928f26..f8f2f4987832 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.dictionary.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatchTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatchTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.json.cs similarity index 95% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.json.cs index 5cc822dcce55..948edc6fee44 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20210801/ScheduledQueryRuleResourcePatchTags.json.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/ScheduledQueryRuleResourcePatchTags.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.ScheduledQueryRule.Models.Api20210801 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScheduledQueryRuleResourcePatchTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new ScheduledQueryRuleResourcePatchTags(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 64% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.PowerShell.cs index 188d47f03dab..8d656dc7279f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 1455885a2b77..70bec53cae34 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.cs index d8d83274d7c2..2106bc978475 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.json.cs similarity index 94% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/SystemData.json.cs index a70e778190fb..4e3260ead0cf 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRul { 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/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.PowerShell.cs similarity index 70% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.PowerShell.cs index c8ad667f8f26..a4fa3ded4cff 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; @@ -65,29 +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.ScheduledQueryRule.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResource(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,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. @@ -132,29 +130,29 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)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. @@ -169,23 +167,23 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs index c53c59477d90..35bebadadc46 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.cs similarity index 74% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.cs index 93e6e6537c87..1cbaa514364b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -11,21 +11,21 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.A /// 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.ScheduledQueryRule.Models.Api10.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Resource(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Id; } /// Backing field for property. private string _location; @@ -35,30 +35,30 @@ public partial class TrackedResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public TrackedResource() @@ -81,12 +81,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.ScheduledQueryRule.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResource { /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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) })] @@ -95,20 +98,23 @@ public partial interface ITrackedResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IResourceInternal { /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.json.cs similarity index 87% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResource.json.cs index fd65d9ecf162..b05da27948cc 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResource.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrackedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; } @@ -88,7 +88,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Jso } __resource?.ToJson(container, serializationMode); AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQue { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.TrackedResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 88% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs index 759c57585aa7..9860751a3df0 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResourceTags(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Mode /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs index a2b166c29b55..3702447f87ee 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.cs similarity index 91% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.cs index de7ea1648aa5..8a833361b83f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; /// Resource tags. public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs index eb9fc9083f22..356542b8d7d0 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10.TrackedResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.json.cs similarity index 96% rename from generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs rename to generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/TrackedResourceTags.json.cs index d75d02866812..fcf69af3b608 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrackedResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/ScheduledQueryRule.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/ScheduledQueryRule.cs index d407d4117bbf..22f1ea867bf5 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/ScheduledQueryRule.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/ScheduledQueryRule.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule public partial class ScheduledQueryRule { - /// Creates or updates a scheduled query rule. + /// update a scheduled query rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. @@ -25,10 +25,11 @@ public partial class ScheduledQueryRule /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesCreateOrUpdate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -55,15 +56,15 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ScheduledQueryRulesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Creates or updates a scheduled query rule. + /// update a scheduled query rule. /// /// The parameters of the rule to create or update. /// a delegate that is called when the remote service returns 200 (OK). @@ -72,10 +73,11 @@ public partial class ScheduledQueryRule /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -114,111 +116,132 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ScheduledQueryRulesCreateOrUpdate_Call (request, onOk,onCreated,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 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a scheduled query rule. + /// + /// The parameters of the rule to create or update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdate_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-08-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var ruleName = _match.Groups["ruleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + ruleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// + /// update a scheduled query rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. - /// The parameters of the rule to create or update. + /// Json string supplied to the ScheduledQueryRulesCreateOrUpdate 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.ScheduledQueryRule.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 ScheduledQueryRulesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string ruleName, 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { + var apiVersion = @"2021-08-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(ruleName),ruleName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + global::System.Uri.EscapeDataString(ruleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Deletes a scheduled query rule. + /// update a scheduled query rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ScheduledQueryRulesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete(string subscriptionId, string resourceGroupName, string ruleName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string ruleName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -236,77 +259,142 @@ public partial class ScheduledQueryRule + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScheduledQueryRulesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ScheduledQueryRulesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Deletes a scheduled query rule. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a scheduled query rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. + /// The parameters of the rule to create or update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", 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.Insights/scheduledQueryRules/{ruleName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var ruleName = _match.Groups["ruleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/scheduledQueryRules/" - + ruleName + + global::System.Uri.EscapeDataString(ruleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScheduledQueryRulesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ScheduledQueryRulesCreateOrUpdateWithResult_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.ScheduledQueryRule.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 ScheduledQueryRulesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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 204 (NoContent). + /// 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. @@ -314,7 +402,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdate_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -325,6 +413,7 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -332,19 +421,19 @@ public partial class ScheduledQueryRule case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -360,17 +449,18 @@ public partial class ScheduledQueryRule } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. + /// The parameters of the rule to create or update. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -380,14 +470,17 @@ public partial class ScheduledQueryRule await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(ruleName),ruleName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Retrieve an scheduled query rule definition. + /// Deletes a scheduled query rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -395,7 +488,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesGet(string subscriptionId, string resourceGroupName, string ruleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete(string subscriptionId, string resourceGroupName, string ruleName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -417,18 +510,19 @@ public partial class ScheduledQueryRule // 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.ScheduledQueryRule.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ScheduledQueryRulesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Retrieve an scheduled query rule definition. + /// Deletes a scheduled query rule. /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -436,7 +530,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesGetViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -470,18 +564,19 @@ public partial class ScheduledQueryRule // 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.ScheduledQueryRule.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ScheduledQueryRulesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -489,7 +584,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesGet_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -500,6 +595,7 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -507,13 +603,19 @@ public partial class ScheduledQueryRule case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -529,8 +631,8 @@ public partial class ScheduledQueryRule } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -539,7 +641,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesGet_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesDelete_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -552,9 +654,10 @@ public partial class ScheduledQueryRule } } - /// Retrieve scheduled query rule definitions in a resource group. + /// Retrieve an scheduled query rule definition. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the rule. /// 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). @@ -563,7 +666,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesListByResourceGroup(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesGet(string subscriptionId, string resourceGroupName, string ruleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -575,7 +678,8 @@ public partial class ScheduledQueryRule + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.Insights/scheduledQueryRules" + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + global::System.Uri.EscapeDataString(ruleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -589,11 +693,11 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ScheduledQueryRulesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieve scheduled query rule definitions in a resource group. + /// Retrieve an scheduled query rule definition. /// /// 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 @@ -603,7 +707,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesListByResourceGroupViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesGetViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -611,22 +715,652 @@ public partial class ScheduledQueryRule { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", 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.Insights/scheduledQueryRules'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var ruleName = _match.Groups["ruleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.Insights/scheduledQueryRules" + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + ruleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve an scheduled query rule definition. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", 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.Insights/scheduledQueryRules/{ruleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var ruleName = _match.Groups["ruleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + ruleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieve an scheduled query rule definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesGetWithResult(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + global::System.Uri.EscapeDataString(ruleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesGetWithResult_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.ScheduledQueryRule.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 ScheduledQueryRulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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 ScheduledQueryRulesGet_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesGet_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(ruleName),ruleName); + } + } + + /// Retrieve scheduled query rule definitions in a resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroup(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve scheduled query rule definitions in a resource group. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroupViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", 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.Insights/scheduledQueryRules'"); + } + + // 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.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve scheduled query rule definitions in a resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", 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.Insights/scheduledQueryRules'"); + } + + // 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.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieve scheduled query rule definitions in a 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.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesListByResourceGroupWithResult_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.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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 ScheduledQueryRulesListByResourceGroup_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Retrieve a scheduled query rule definitions in a subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscription(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve a scheduled query rule definitions in a subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscriptionViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'"); + } + + // 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.Insights/scheduledQueryRules" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -638,14 +1372,158 @@ public partial class ScheduledQueryRule var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScheduledQueryRulesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve a scheduled query rule definitions in a subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'"); + } + + // 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.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieve a scheduled query rule definitions in a subscription. + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-08-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Insights/scheduledQueryRules" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesListBySubscriptionWithResult_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.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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). @@ -656,7 +1534,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListByResourceGroup_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListBySubscription_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -667,6 +1545,7 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -674,13 +1553,13 @@ public partial class ScheduledQueryRule case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -696,38 +1575,38 @@ public partial class ScheduledQueryRule } /// - /// Validation method for method. Call this like the actual call, but + /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); } } - /// Retrieve a scheduled query rule definitions in a subscription. + /// update a scheduled query rule. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. + /// The parameters of the rule to update. /// 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.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscription(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -737,7 +1616,10 @@ public partial class ScheduledQueryRule var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Insights/scheduledQueryRules" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + global::System.Uri.EscapeDataString(ruleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -746,26 +1628,32 @@ public partial class ScheduledQueryRule // 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.ScheduledQueryRule.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ScheduledQueryRulesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieve a scheduled query rule definitions in a subscription. + /// update a scheduled query rule. /// + /// The parameters of the rule to update. /// 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.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscriptionViaIdentity(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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -773,19 +1661,24 @@ public partial class ScheduledQueryRule { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var ruleName = _match.Groups["ruleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.Insights/scheduledQueryRules" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + ruleName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -794,98 +1687,136 @@ public partial class ScheduledQueryRule // 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.ScheduledQueryRule.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScheduledQueryRulesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.ScheduledQueryRulesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a scheduled query rule. + /// + /// The parameters of the rule to update. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesListBySubscription_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-08-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourceCollection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var ruleName = _match.Groups["ruleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + ruleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScheduledQueryRulesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update a scheduled query rule. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. + /// Json string supplied to the ScheduledQueryRulesUpdate 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.ScheduledQueryRule.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 ScheduledQueryRulesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string ruleName, 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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { + var apiVersion = @"2021-08-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Insights/scheduledQueryRules/" + + global::System.Uri.EscapeDataString(ruleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScheduledQueryRulesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update a scheduled query rule. + /// update a scheduled query rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the rule. - /// The parameters of the rule to update. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ScheduledQueryRulesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string ruleName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { var apiVersion = @"2021-08-01"; // Constant Parameters @@ -903,82 +1834,133 @@ public partial class ScheduledQueryRule + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScheduledQueryRulesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ScheduledQueryRulesUpdateWithResult_Call (request, eventListener,sender); } } - /// Update a scheduled query rule. - /// + /// update a scheduled query rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the rule. /// The parameters of the rule to update. - /// 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.ScheduledQueryRule.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdateWithResult(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-08-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Insights/scheduledQueryRules/(?[^/]+)$", 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.Insights/scheduledQueryRules/{ruleName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var ruleName = _match.Groups["ruleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.Insights/scheduledQueryRules/" - + ruleName + + global::System.Uri.EscapeDataString(ruleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScheduledQueryRulesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ScheduledQueryRulesUpdateWithResult_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.ScheduledQueryRule.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 ScheduledQueryRulesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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 @@ -988,7 +1970,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate_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.ScheduledQueryRule.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -999,6 +1981,7 @@ public partial class ScheduledQueryRule await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1006,13 +1989,13 @@ public partial class ScheduledQueryRule case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ErrorContract.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1039,7 +2022,7 @@ public partial class ScheduledQueryRule /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ScheduledQueryRulesUpdate_Validate(string subscriptionId, string resourceGroupName, string ruleName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.Completer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.Completer.cs deleted file mode 100644 index cb84b680f142..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.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.ScheduledQueryRule.Support -{ - - /// - /// The criteria operator. Relevant and required only for rules of the kind LogAlert. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperatorTypeConverter))] - public partial struct ConditionOperator : - 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) || "Equals".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Equals'", "Equals", global::System.Management.Automation.CompletionResultType.ParameterValue, "Equals"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThan'", "GreaterThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GreaterThanOrEqual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GreaterThanOrEqual'", "GreaterThanOrEqual", global::System.Management.Automation.CompletionResultType.ParameterValue, "GreaterThanOrEqual"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThan'", "LessThan", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LessThanOrEqual".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LessThanOrEqual'", "LessThanOrEqual", global::System.Management.Automation.CompletionResultType.ParameterValue, "LessThanOrEqual"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.TypeConverter.cs deleted file mode 100644 index c1251fe33155..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.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.ScheduledQueryRule.Support -{ - - /// - /// The criteria operator. Relevant and required only for rules of the kind LogAlert. - /// - public partial class ConditionOperatorTypeConverter : - 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) => ConditionOperator.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/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.cs deleted file mode 100644 index 55922d6c1287..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/ConditionOperator.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.ScheduledQueryRule.Support -{ - - /// - /// The criteria operator. Relevant and required only for rules of the kind LogAlert. - /// - public partial struct ConditionOperator : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator Equal = @"Equals"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator GreaterThan = @"GreaterThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator GreaterThanOrEqual = @"GreaterThanOrEqual"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator LessThan = @"LessThan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator LessThanOrEqual = @"LessThanOrEqual"; - - /// 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 ConditionOperator(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ConditionOperator - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ConditionOperator(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ConditionOperator - /// 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.ScheduledQueryRule.Support.ConditionOperator e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ConditionOperator (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 ConditionOperator && Equals((ConditionOperator)obj); - } - - /// Returns hashCode for enum ConditionOperator - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ConditionOperator - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ConditionOperator - /// the value to convert to an instance of . - - public static implicit operator ConditionOperator(string value) - { - return new ConditionOperator(value); - } - - /// Implicit operator to convert ConditionOperator to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator e) - { - return e._value; - } - - /// Overriding != operator for enum ConditionOperator - /// 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.ScheduledQueryRule.Support.ConditionOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ConditionOperator - /// 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.ScheduledQueryRule.Support.ConditionOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.ConditionOperator e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index c7cef1a67047..000000000000 --- a/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index f1a43caeb24e..000000000000 --- a/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 9b473f88d598..000000000000 --- a/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.Completer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.Completer.cs deleted file mode 100644 index 6df3b826f312..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.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.ScheduledQueryRule.Support -{ - - /// Operator for dimension values - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperatorTypeConverter))] - public partial struct DimensionOperator : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Include".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Include'", "Include", global::System.Management.Automation.CompletionResultType.ParameterValue, "Include"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Exclude".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Exclude'", "Exclude", global::System.Management.Automation.CompletionResultType.ParameterValue, "Exclude"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.TypeConverter.cs deleted file mode 100644 index 271667c50b71..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.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.ScheduledQueryRule.Support -{ - - /// Operator for dimension values - public partial class DimensionOperatorTypeConverter : - 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) => DimensionOperator.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/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.cs deleted file mode 100644 index 548e9ccab1ff..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/DimensionOperator.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.ScheduledQueryRule.Support -{ - - /// Operator for dimension values - public partial struct DimensionOperator : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator Exclude = @"Exclude"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator Include = @"Include"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DimensionOperator - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DimensionOperator(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DimensionOperator(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DimensionOperator - /// 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.ScheduledQueryRule.Support.DimensionOperator e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DimensionOperator (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 DimensionOperator && Equals((DimensionOperator)obj); - } - - /// Returns hashCode for enum DimensionOperator - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DimensionOperator - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DimensionOperator - /// the value to convert to an instance of . - - public static implicit operator DimensionOperator(string value) - { - return new DimensionOperator(value); - } - - /// Implicit operator to convert DimensionOperator to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator e) - { - return e._value; - } - - /// Overriding != operator for enum DimensionOperator - /// 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.ScheduledQueryRule.Support.DimensionOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DimensionOperator - /// 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.ScheduledQueryRule.Support.DimensionOperator e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.DimensionOperator e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.Completer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.Completer.cs deleted file mode 100644 index 3510f6d4cf52..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.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.ScheduledQueryRule.Support -{ - - /// Indicates the type of scheduled query rule. The default is LogAlert. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.KindTypeConverter))] - public partial struct Kind : - 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) || "LogAlert".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LogAlert'", "LogAlert", global::System.Management.Automation.CompletionResultType.ParameterValue, "LogAlert"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LogToMetric".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LogToMetric'", "LogToMetric", global::System.Management.Automation.CompletionResultType.ParameterValue, "LogToMetric"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.TypeConverter.cs deleted file mode 100644 index a04bb4f411fc..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.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.ScheduledQueryRule.Support -{ - - /// Indicates the type of scheduled query rule. The default is LogAlert. - public partial class KindTypeConverter : - 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) => Kind.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/ScheduledQueryRule.Autorest/generated/api/Support/Kind.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.cs deleted file mode 100644 index ad90d957567f..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/Kind.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.ScheduledQueryRule.Support -{ - - /// Indicates the type of scheduled query rule. The default is LogAlert. - public partial struct Kind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind LogAlert = @"LogAlert"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind LogToMetric = @"LogToMetric"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Kind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Kind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Kind - /// 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.ScheduledQueryRule.Support.Kind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Kind (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 Kind && Equals((Kind)obj); - } - - /// Returns hashCode for enum Kind - /// 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 Kind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Kind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Kind - /// the value to convert to an instance of . - - public static implicit operator Kind(string value) - { - return new Kind(value); - } - - /// Implicit operator to convert Kind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind e) - { - return e._value; - } - - /// Overriding != operator for enum Kind - /// 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.ScheduledQueryRule.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Kind - /// 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.ScheduledQueryRule.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.Completer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.Completer.cs deleted file mode 100644 index ee5b80ea06e2..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.Completer.cs +++ /dev/null @@ -1,51 +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.ScheduledQueryRule.Support -{ - - /// Aggregation type. Relevant and required only for rules of the kind LogAlert. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregationTypeConverter))] - public partial struct TimeAggregation : - 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) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Average".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Average'", "Average", global::System.Management.Automation.CompletionResultType.ParameterValue, "Average"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Minimum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Minimum'", "Minimum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Minimum"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Maximum".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Maximum'", "Maximum", global::System.Management.Automation.CompletionResultType.ParameterValue, "Maximum"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Total".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Total'", "Total", global::System.Management.Automation.CompletionResultType.ParameterValue, "Total"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.TypeConverter.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.TypeConverter.cs deleted file mode 100644 index 9c4760df049e..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.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.ScheduledQueryRule.Support -{ - - /// Aggregation type. Relevant and required only for rules of the kind LogAlert. - public partial class TimeAggregationTypeConverter : - 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) => TimeAggregation.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/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.cs deleted file mode 100644 index e20c40cced16..000000000000 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/api/Support/TimeAggregation.cs +++ /dev/null @@ -1,104 +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.ScheduledQueryRule.Support -{ - - /// Aggregation type. Relevant and required only for rules of the kind LogAlert. - public partial struct TimeAggregation : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation Average = @"Average"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation Count = @"Count"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation Maximum = @"Maximum"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation Minimum = @"Minimum"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation Total = @"Total"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TimeAggregation - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TimeAggregation(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TimeAggregation - /// 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.ScheduledQueryRule.Support.TimeAggregation e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TimeAggregation (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 TimeAggregation && Equals((TimeAggregation)obj); - } - - /// Returns hashCode for enum TimeAggregation - /// 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 TimeAggregation(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for TimeAggregation - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to TimeAggregation - /// the value to convert to an instance of . - - public static implicit operator TimeAggregation(string value) - { - return new TimeAggregation(value); - } - - /// Implicit operator to convert TimeAggregation to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation e) - { - return e._value; - } - - /// Overriding != operator for enum TimeAggregation - /// 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.ScheduledQueryRule.Support.TimeAggregation e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TimeAggregation - /// 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.ScheduledQueryRule.Support.TimeAggregation e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.TimeAggregation e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_Get.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_Get.cs index d268526e8054..06e60f2b3a75 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_Get.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Retrieve an scheduled query rule definition. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzScheduledQueryRule_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Retrieve an scheduled query rule definition.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class GetAzScheduledQueryRule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzScheduledQueryRule_Get : 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 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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzScheduledQueryRule_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +113,7 @@ public partial class GetAzScheduledQueryRule_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,7 +159,8 @@ public partial class GetAzScheduledQueryRule_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +169,24 @@ public partial class GetAzScheduledQueryRule_Get : 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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +235,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzScheduledQueryRule_Get() { @@ -260,8 +286,33 @@ public GetAzScheduledQueryRule_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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +365,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -373,12 +424,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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -395,15 +446,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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -413,12 +464,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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -430,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_GetViaIdentity.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_GetViaIdentity.cs index 24339280a648..fdce3ceb3afd 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_GetViaIdentity.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Retrieve an scheduled query rule definition. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzScheduledQueryRule_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Retrieve an scheduled query rule definition.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class GetAzScheduledQueryRule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +37,26 @@ public partial class GetAzScheduledQueryRule_GetViaIdentity : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzScheduledQueryRule_GetViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +107,7 @@ public partial class GetAzScheduledQueryRule_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +130,24 @@ public partial class GetAzScheduledQueryRule_GetViaIdentity : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -171,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzScheduledQueryRule_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzScheduledQueryRule_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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -276,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 +424,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List.cs index cbc20c94b25a..85f3242824db 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Retrieve a scheduled query rule definitions in a subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzScheduledQueryRule_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Retrieve a scheduled query rule definitions in a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules", ApiVersion = "2021-08-01")] public partial class GetAzScheduledQueryRule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzScheduledQueryRule_List : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzScheduledQueryRule_List : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +105,7 @@ public partial class GetAzScheduledQueryRule_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +137,8 @@ public partial class GetAzScheduledQueryRule_List : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzScheduledQueryRule_List : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection /// 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 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzScheduledQueryRule_List() { @@ -238,8 +264,33 @@ public GetAzScheduledQueryRule_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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +402,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 +424,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection /// 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 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection + 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/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List1.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List1.cs index 6427d2b4fa57..d3f0ad50c07d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List1.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/GetAzScheduledQueryRule_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Retrieve scheduled query rule definitions in a resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzScheduledQueryRule_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Retrieve scheduled query rule definitions in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules", ApiVersion = "2021-08-01")] public partial class GetAzScheduledQueryRule_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +37,32 @@ public partial class GetAzScheduledQueryRule_List1 : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzScheduledQueryRule_List1 : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +105,7 @@ public partial class GetAzScheduledQueryRule_List1 : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +151,8 @@ public partial class GetAzScheduledQueryRule_List1 : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzScheduledQueryRule_List1 : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzScheduledQueryRule_List1() { @@ -252,8 +278,33 @@ public GetAzScheduledQueryRule_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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourceCollection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection /// 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 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourceCollection + 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/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateExpanded.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateExpanded.cs index 9d6c01ff2e9a..b453a8e395bc 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateExpanded.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; - /// Creates or updates a scheduled query rule. + /// create a scheduled query rule. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzScheduledQueryRule_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Creates or updates a scheduled query rule.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"create a scheduled query rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The scheduled query rule resource. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResource(); + + /// + /// 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 properties of an alert payload. [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -47,8 +61,8 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man ReadOnly = false, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } /// Action Group resource Ids to invoke when the alert fires. [global::System.Management.Automation.AllowEmptyCollection] @@ -60,7 +74,7 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup ?? null /* arrayOf */; set => _parametersBody.ActionGroup = value; } + public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only @@ -81,6 +95,9 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is /// false. Relevant only for rules of the kind LogAlert. @@ -107,8 +124,8 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man ReadOnly = false, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf ?? null /* arrayOf */; set => _parametersBody.CriterionAllOf = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.CriterionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -169,6 +186,9 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man PossibleTypes = new [] { typeof(global::System.TimeSpan) })] public global::System.TimeSpan EvaluationFrequency { get => _parametersBody.EvaluationFrequency ?? default(global::System.TimeSpan); set => _parametersBody.EvaluationFrequency = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -192,9 +212,9 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Indicates the type of scheduled query rule. The default is LogAlert.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind))] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support.Kind)""); set => _parametersBody.Kind = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.PSArgumentCompleterAttribute("LogAlert", "LogToMetric")] + public string Kind { get => _parametersBody.Kind ?? null; set => _parametersBody.Kind = value; } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -260,7 +280,7 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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")] @@ -302,7 +322,7 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - public string[] Scope { get => _parametersBody.Scope ?? null /* arrayOf */; set => _parametersBody.Scope = value; } + public string[] Scope { get => _parametersBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules @@ -346,7 +366,8 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -359,8 +380,8 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api10.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ITrackedResourceTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -376,7 +397,7 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - public string[] TargetResourceType { get => _parametersBody.TargetResourceType ?? null /* arrayOf */; set => _parametersBody.TargetResourceType = value; } + public string[] TargetResourceType { get => _parametersBody.TargetResourceType?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.TargetResourceType = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required @@ -397,36 +418,36 @@ public partial class NewAzScheduledQueryRule_CreateExpanded : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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) @@ -449,6 +470,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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -513,8 +539,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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -524,7 +575,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzScheduledQueryRule_CreateExpanded() { @@ -578,7 +629,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -591,12 +642,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ScheduledQueryRulesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.ScheduledQueryRulesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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=_parametersBody}) + 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 } }); @@ -632,12 +683,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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 ) { @@ -649,8 +700,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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; + } + } } } @@ -658,12 +727,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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 ) { @@ -680,15 +749,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.ScheduledQueryRule.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=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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=_parametersBody }) + 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 } }); @@ -698,12 +767,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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 ) { @@ -715,8 +784,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonFilePath.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..17cc68dcf8f2 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonFilePath.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.ScheduledQueryRule.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; + using System; + + /// create a scheduled query rule. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzScheduledQueryRule_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"create a scheduled query rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.NotSuggestDefaultParameterSet] + public partial class NewAzScheduledQueryRule_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rule.", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 NewAzScheduledQueryRule_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScheduledQueryRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ScheduledQueryRulesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonString.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonString.cs new file mode 100644 index 000000000000..9d8569a8fc1f --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/NewAzScheduledQueryRule_CreateViaJsonString.cs @@ -0,0 +1,575 @@ +// 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.ScheduledQueryRule.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; + using System; + + /// create a scheduled query rule. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzScheduledQueryRule_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"create a scheduled query rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.NotSuggestDefaultParameterSet] + public partial class NewAzScheduledQueryRule_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rule.", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 NewAzScheduledQueryRule_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScheduledQueryRulesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ScheduledQueryRulesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_Delete.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_Delete.cs index e478d8dbafeb..cdb0126d6d68 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_Delete.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Deletes a scheduled query rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class RemoveAzScheduledQueryRule_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzScheduledQueryRule_Delete : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzScheduledQueryRule_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,7 +120,7 @@ public partial class RemoveAzScheduledQueryRule_Delete : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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")] @@ -145,7 +166,8 @@ public partial class RemoveAzScheduledQueryRule_Delete : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,12 +176,12 @@ public partial class RemoveAzScheduledQueryRule_Delete : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 @@ -202,6 +224,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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -266,8 +293,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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -323,7 +375,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +393,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 } }); @@ -354,7 +406,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzScheduledQueryRule_Delete() { @@ -387,12 +439,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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 ) { @@ -409,15 +461,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.ScheduledQueryRule.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.ScheduledQueryRule.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 } }); @@ -442,7 +494,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -466,7 +518,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/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_DeleteViaIdentity.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_DeleteViaIdentity.cs index 049c23e47f10..8d555fc599b5 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_DeleteViaIdentity.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/RemoveAzScheduledQueryRule_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; /// Deletes a scheduled query rule. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class RemoveAzScheduledQueryRule_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzScheduledQueryRule_DeleteViaIdentity : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzScheduledQueryRule_DeleteViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzScheduledQueryRule_DeleteViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzScheduledQueryRule_DeleteViaIdentity : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 @@ -164,6 +185,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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 } }); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzScheduledQueryRule_DeleteViaIdentity() { @@ -369,12 +420,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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 ) { @@ -391,7 +442,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.ScheduledQueryRule.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 } @@ -424,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); } @@ -448,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/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateExpanded.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateExpanded.cs index 7e458adc3dd8..74e6c4eca7c4 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateExpanded.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; - /// Update a scheduled query rule. + /// update a scheduled query rule. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzScheduledQueryRule_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Update a scheduled query rule.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"update a scheduled query rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The scheduled query rule resource for patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatch(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatch(); + + /// + /// 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 properties of an alert payload. [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -47,8 +61,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. ReadOnly = false, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } /// Action Group resource Ids to invoke when the alert fires. [global::System.Management.Automation.AllowEmptyCollection] @@ -60,7 +74,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup ?? null /* arrayOf */; set => _parametersBody.ActionGroup = value; } + public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only @@ -81,6 +95,9 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is /// false. Relevant only for rules of the kind LogAlert. @@ -107,8 +124,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. ReadOnly = false, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf ?? null /* arrayOf */; set => _parametersBody.CriterionAllOf = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.CriterionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -169,6 +186,9 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. PossibleTypes = new [] { typeof(global::System.TimeSpan) })] public global::System.TimeSpan EvaluationFrequency { get => _parametersBody.EvaluationFrequency ?? default(global::System.TimeSpan); set => _parametersBody.EvaluationFrequency = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -237,7 +257,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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")] @@ -279,7 +299,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - public string[] Scope { get => _parametersBody.Scope ?? null /* arrayOf */; set => _parametersBody.Scope = value; } + public string[] Scope { get => _parametersBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules @@ -323,7 +343,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -336,8 +357,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -353,7 +374,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : global::System. Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - public string[] TargetResourceType { get => _parametersBody.TargetResourceType ?? null /* arrayOf */; set => _parametersBody.TargetResourceType = value; } + public string[] TargetResourceType { get => _parametersBody.TargetResourceType?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.TargetResourceType = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required @@ -374,24 +395,24 @@ public partial class UpdateAzScheduledQueryRule_UpdateExpanded : 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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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) @@ -414,6 +435,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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -478,8 +504,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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -535,7 +586,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -548,12 +599,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ScheduledQueryRulesUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ScheduledQueryRulesUpdate(SubscriptionId, ResourceGroupName, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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=_parametersBody}) + 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 } }); @@ -573,7 +624,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzScheduledQueryRule_UpdateExpanded() { @@ -599,12 +650,12 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 ) { @@ -621,15 +672,15 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.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=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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=_parametersBody }) + 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 } }); @@ -639,12 +690,12 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 ) { @@ -656,8 +707,26 @@ public UpdateAzScheduledQueryRule_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded.cs index 4aad28aef149..d270c068da0a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; using System; - /// Update a scheduled query rule. + /// update a scheduled query rule. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzScheduledQueryRule_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, NewOutputProperties=new string[] {"ActionGroup","CriterionAllOf","Scope","TargetResourceType"}, ChangeDescription="The types of the properties ActionGroup, CriterionAllOf, Scope and TargetResourceType will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"Update a scheduled query rule.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"update a scheduled query rule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,20 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The scheduled query rule resource for patch operations. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ScheduledQueryRuleResourcePatch(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ScheduledQueryRuleResourcePatch(); + + /// + /// 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 properties of an alert payload. [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -47,8 +61,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"The properties of an alert payload.", SerializedName = @"customProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IActionsCustomProperties ActionCustomProperty { get => _parametersBody.ActionCustomProperty ?? null /* object */; set => _parametersBody.ActionCustomProperty = value; } /// Action Group resource Ids to invoke when the alert fires. [global::System.Management.Automation.AllowEmptyCollection] @@ -60,7 +74,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob Description = @"Action Group resource Ids to invoke when the alert fires.", SerializedName = @"actionGroups", PossibleTypes = new [] { typeof(string) })] - public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup ?? null /* arrayOf */; set => _parametersBody.ActionGroup = value; } + public string[] ActionGroupResourceId { get => _parametersBody.ActionGroup?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.ActionGroup = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only @@ -81,6 +95,9 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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 flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is /// false. Relevant only for rules of the kind LogAlert. @@ -107,8 +124,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"A list of conditions to evaluate against the specified scopes", SerializedName = @"allOf", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf ?? null /* arrayOf */; set => _parametersBody.CriterionAllOf = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.ICondition[] CriterionAllOf { get => _parametersBody.CriterionAllOf?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.CriterionAllOf = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -169,6 +186,9 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob PossibleTypes = new [] { typeof(global::System.TimeSpan) })] public global::System.TimeSpan EvaluationFrequency { get => _parametersBody.EvaluationFrequency ?? default(global::System.TimeSpan); set => _parametersBody.EvaluationFrequency = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -231,7 +251,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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")] @@ -259,7 +279,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob Description = @"The list of resource id's that this scheduled query rule is scoped to.", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - public string[] Scope { get => _parametersBody.Scope ?? null /* arrayOf */; set => _parametersBody.Scope = value; } + public string[] Scope { get => _parametersBody.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules @@ -298,8 +318,8 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResourcePatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResourcePatchTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } /// /// List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource @@ -315,7 +335,7 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob Description = @"List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only for rules of the kind LogAlert", SerializedName = @"targetResourceTypes", PossibleTypes = new [] { typeof(string) })] - public string[] TargetResourceType { get => _parametersBody.TargetResourceType ?? null /* arrayOf */; set => _parametersBody.TargetResourceType = value; } + public string[] TargetResourceType { get => _parametersBody.TargetResourceType?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.TargetResourceType = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required @@ -336,24 +356,24 @@ public partial class UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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) @@ -376,6 +396,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.ScheduledQueryRule.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -440,8 +465,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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -497,7 +547,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -512,7 +562,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ScheduledQueryRulesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ScheduledQueryRulesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate); } else { @@ -529,13 +579,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RuleName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ScheduledQueryRulesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.RuleName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ScheduledQueryRulesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.RuleName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + 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 } }); @@ -555,7 +605,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded() { @@ -581,12 +631,12 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.Models.Api20210801.IErrorContract + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IErrorContract /// 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 ) { @@ -603,15 +653,15 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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=_parametersBody }) + 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 } }); @@ -621,12 +671,12 @@ public UpdateAzScheduledQueryRule_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.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource /// 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 ) { @@ -638,8 +688,26 @@ public UpdateAzScheduledQueryRule_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.Api20210801.IScheduledQueryRuleResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonFilePath.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..f53353ef1676 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonFilePath.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.ScheduledQueryRule.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; + using System; + + /// update a scheduled query rule. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzScheduledQueryRule_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"update a scheduled query rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.NotSuggestDefaultParameterSet] + public partial class UpdateAzScheduledQueryRule_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rule.", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScheduledQueryRulesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ScheduledQueryRulesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzScheduledQueryRule_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonString.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonString.cs new file mode 100644 index 000000000000..126fba03f911 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/cmdlets/UpdateAzScheduledQueryRule_UpdateViaJsonString.cs @@ -0,0 +1,521 @@ +// 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.ScheduledQueryRule.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Cmdlets; + using System; + + /// update a scheduled query rule. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzScheduledQueryRule_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Models.IScheduledQueryRuleResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Description(@"update a scheduled query rule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}", ApiVersion = "2021-08-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.NotSuggestDefaultParameterSet] + public partial class UpdateAzScheduledQueryRule_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rule. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rule.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rule.", + SerializedName = @"ruleName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScheduledQueryRulesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ScheduledQueryRulesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzScheduledQueryRule_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule.Models.IErrorContract + /// 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.ScheduledQueryRule.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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + /// 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.ScheduledQueryRule.Models.IScheduledQueryRuleResource + 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/ScheduledQueryRule.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..4d713b3f96d4 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule +{ + 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/ScheduledQueryRule.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..7fb5f98d722f --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule +{ + 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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index c313b349e07e..4e946cb3e82f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 995e8d6357d4..fd15d11edb81 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index d44ec7468dad..1fa155dd0616 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 3b60928975a5..4cee6cd92075 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 2685698bed6e..6bc22a1e2ec5 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index fe4609caca65..29b59abab94b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 51d15e642f66..b74e33279f56 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index c6cf3b40469d..f692bec6819b 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 7a7bdcb6aae4..93c06496c043 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index eb4528cd338a..f401a8aab8b4 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 57d7837717c3..6623d4a35039 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 6a15f168549c..5f79270840a5 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.Runtime. { 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/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 7326502f4aaf..ed2c13baf9f7 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/Context.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..636902fb2161 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.ScheduledQueryRule Client { get; } + } +} diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Events.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Events.cs index 6b00c0f51863..e0077153623a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/ISendAsync.cs index d881d82cb049..f967e602c601 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/InfoAttribute.cs index 73ecfecf645f..3bce6f4626b1 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..7430a7179530 --- /dev/null +++ b/generated/Monitor/ScheduledQueryRule.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.ScheduledQueryRule.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.ScheduledQueryRule.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/MessageAttribute.cs index fc8031e5a947..7747d28f136a 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ScheduledQueryRule.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.ScheduledQueryRule" : @"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/ScheduledQueryRule.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 8362faac09e2..970fcbf306a0 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/SerializationMode.cs index 59361ecdf037..9f45147df8cb 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/TypeConverterExtensions.cs index 09dfa6451efc..c16319c2c653 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/ScheduledQueryRule.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/ScheduledQueryRule.Autorest/test-module.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/test-module.ps1 index 8c5e92366405..91050bc2ee20 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/test-module.ps1 +++ b/generated/Monitor/ScheduledQueryRule.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/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml b/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml index 334d1805dabe..74803cdb597a 100644 --- a/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml +++ b/generated/Resources/Authorization.Autorest/Az.Authorization.format.ps1xml @@ -2,75 +2,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings#Multiple - - - - - - - - - - - - - - - - - - - + - + - + - + - Id - - - RoleAssignmentScheduleInstanceName - - - RoleAssignmentScheduleName - - - RoleAssignmentScheduleRequestName - - - RoleEligibilityScheduleInstanceName - - - RoleEligibilityScheduleName - - - RoleEligibilityScheduleRequestName + ApprovalMode - RoleManagementPolicyAssignmentName + IsApprovalRequired - RoleManagementPolicyName + IsApprovalRequiredForExtension - Scope + IsRequestorJustificationRequired @@ -78,39 +42,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage#Multiple - + - + - + - + - ApprovalMode + EscalationTimeInMinute - IsApprovalRequired + IsApproverJustificationRequired - IsApprovalRequiredForExtension + IsEscalationEnabled - IsRequestorJustificationRequired + TimeOutInDay @@ -118,39 +82,75 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.AuthorizationIdentity#Multiple - + - + - + - + + + + + + + + + + + + + + + + + + + - EscalationTimeInMinute + Id - IsApproverJustificationRequired + RoleAssignmentScheduleInstanceName - IsEscalationEnabled + RoleAssignmentScheduleName - TimeOutInDay + RoleAssignmentScheduleRequestName + + + RoleEligibilityScheduleInstanceName + + + RoleEligibilityScheduleName + + + RoleEligibilityScheduleRequestName + + + RoleManagementPolicyAssignmentName + + + RoleManagementPolicyName + + + Scope @@ -158,9 +158,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody#Multiple @@ -186,9 +186,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource#Multiple @@ -220,9 +220,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult#Multiple @@ -242,9 +242,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal#Multiple @@ -282,9 +282,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition#Multiple @@ -316,9 +316,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope#Multiple @@ -350,9 +350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy#Multiple @@ -378,9 +378,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition#Multiple @@ -412,9 +412,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope#Multiple @@ -446,9 +446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope#Multiple @@ -480,9 +480,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal#Multiple @@ -520,9 +520,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule#Multiple @@ -572,9 +572,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleFilter#Multiple @@ -606,9 +606,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance#Multiple @@ -658,9 +658,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceFilter#Multiple @@ -698,9 +698,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult#Multiple @@ -720,9 +720,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties#Multiple @@ -832,9 +832,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult#Multiple @@ -854,9 +854,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties#Multiple @@ -960,9 +960,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest#Multiple @@ -1012,9 +1012,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestFilter#Multiple @@ -1052,9 +1052,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult#Multiple @@ -1074,9 +1074,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties#Multiple @@ -1180,9 +1180,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo#Multiple @@ -1202,9 +1202,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration#Multiple @@ -1236,9 +1236,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo#Multiple @@ -1264,9 +1264,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule#Multiple @@ -1316,9 +1316,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleFilter#Multiple @@ -1350,9 +1350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance#Multiple @@ -1402,9 +1402,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceFilter#Multiple @@ -1442,9 +1442,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult#Multiple @@ -1464,9 +1464,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties#Multiple @@ -1552,9 +1552,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult#Multiple @@ -1574,9 +1574,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties#Multiple @@ -1668,9 +1668,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest#Multiple @@ -1720,9 +1720,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestFilter - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestFilter + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestFilter#Multiple @@ -1760,9 +1760,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult#Multiple @@ -1782,9 +1782,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties#Multiple @@ -1882,9 +1882,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo#Multiple @@ -1904,9 +1904,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration#Multiple @@ -1938,9 +1938,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo#Multiple @@ -1966,9 +1966,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy#Multiple @@ -2006,9 +2006,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyApprovalRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyApprovalRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyApprovalRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyApprovalRule#Multiple @@ -2021,21 +2021,9 @@ - - - - - - - - - - - - @@ -2049,30 +2037,18 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment#Multiple @@ -2122,9 +2098,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult#Multiple @@ -2144,9 +2120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties#Multiple @@ -2178,9 +2154,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAuthenticationContextRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAuthenticationContextRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAuthenticationContextRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAuthenticationContextRule#Multiple @@ -2193,21 +2169,9 @@ - - - - - - - - - - - - @@ -2227,21 +2191,9 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - ClaimValue @@ -2254,9 +2206,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyEnablementRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyEnablementRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyEnablementRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyEnablementRule#Multiple @@ -2269,24 +2221,9 @@ - - - - - - - - - - - - - - - @@ -2300,33 +2237,18 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - - - EnabledRule - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyExpirationRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyExpirationRule#Multiple @@ -2339,21 +2261,9 @@ - - - - - - - - - - - - @@ -2373,21 +2283,9 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - IsExpirationRequired @@ -2400,9 +2298,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult#Multiple @@ -2422,9 +2320,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyNotificationRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyNotificationRule#Multiple @@ -2437,30 +2335,15 @@ - - - - - - - - - - - - - - - @@ -2480,30 +2363,15 @@ TargetCaller - - TargetEnforcedSetting - - - TargetInheritableSetting - TargetLevel - - TargetObject - - - TargetOperation - IsDefaultRecipientsEnabled NotificationLevel - - NotificationRecipient - NotificationType @@ -2516,9 +2384,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties#Multiple @@ -2562,9 +2430,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule#Multiple @@ -2590,30 +2458,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget#Multiple - - - - - - - - - - - - @@ -2621,30 +2477,18 @@ Caller - - EnforcedSetting - - - InheritableSetting - Level - - Operation - - - TargetObject - - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet#Multiple diff --git a/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 b/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 index 6a0e0212da5d..e5b022b5b7cf 100644 --- a/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 +++ b/generated/Resources/Authorization.Autorest/Az.Authorization.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Authorization.private.dll' FormatsToProcess = './Az.Authorization.format.ps1xml' - FunctionsToExport = 'Get-AzRoleAssignmentSchedule', 'Get-AzRoleAssignmentScheduleInstance', 'Get-AzRoleAssignmentScheduleRequest', 'Get-AzRoleEligibilitySchedule', 'Get-AzRoleEligibilityScheduleInstance', 'Get-AzRoleEligibilityScheduleRequest', 'Get-AzRoleEligibleChildResource', 'Get-AzRoleManagementPolicy', 'Get-AzRoleManagementPolicyAssignment', 'New-AzRoleAssignmentScheduleRequest', 'New-AzRoleEligibilityScheduleRequest', 'New-AzRoleManagementPolicyAssignment', 'Remove-AzRoleManagementPolicy', 'Remove-AzRoleManagementPolicyAssignment', 'Stop-AzRoleAssignmentScheduleRequest', 'Stop-AzRoleEligibilityScheduleRequest', 'Update-AzRoleManagementPolicy', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzRoleAssignmentSchedule', 'Get-AzRoleAssignmentScheduleInstance', 'Get-AzRoleAssignmentScheduleRequest', 'Get-AzRoleEligibilitySchedule', 'Get-AzRoleEligibilityScheduleInstance', 'Get-AzRoleEligibilityScheduleRequest', 'Get-AzRoleEligibleChildResource', 'Get-AzRoleManagementPolicy', 'Get-AzRoleManagementPolicyAssignment', 'New-AzRoleAssignmentScheduleRequest', 'New-AzRoleEligibilityScheduleRequest', 'New-AzRoleManagementPolicyAssignment', 'Remove-AzRoleManagementPolicy', 'Remove-AzRoleManagementPolicyAssignment', 'Stop-AzRoleAssignmentScheduleRequest', 'Stop-AzRoleEligibilityScheduleRequest', 'Update-AzRoleAssignmentScheduleRequest', 'Update-AzRoleEligibilityScheduleRequest', 'Update-AzRoleManagementPolicy', 'Update-AzRoleManagementPolicyAssignment' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Authorization' diff --git a/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs b/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs index f15d49147166..81c0c1fe4e12 100644 --- a/generated/Resources/Authorization.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Resources/Authorization.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 - Authorization")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("8.0.1")] -[assembly: System.Reflection.AssemblyVersionAttribute("8.0.1")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Resources/Authorization.Autorest/check-dependencies.ps1 b/generated/Resources/Authorization.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Resources/Authorization.Autorest/check-dependencies.ps1 +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 index 2fe3f1345674..54503191d71a 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentSchedule.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentSchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708c .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedule #> function Get-AzRoleAssignmentSchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 index 14993662673e..5eaf6770c72e 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleInstance.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-969 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentscheduleinstance #> function Get-AzRoleAssignmentScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 index 175e0ae89b6f..d0ae761319da 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleAssignmentScheduleRequest.ps1 @@ -35,7 +35,7 @@ Get-AzRoleAssignmentScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0bc .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -56,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedulerequest #> function Get-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -77,7 +77,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 index 4391f3e0cd9d..32e016031467 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilitySchedule.ps1 @@ -36,7 +36,7 @@ Get-AzRoleEligibilitySchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedule #> function Get-AzRoleEligibilitySchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 index ff6e6ef71529..383fd163cefe 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleInstance.ps1 @@ -36,7 +36,7 @@ Get-AzRoleEligibilityScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-96 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityscheduleinstance #> function Get-AzRoleEligibilityScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 index 1e7f581bdaa7..2b5b8dbcf614 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibilityScheduleRequest.ps1 @@ -35,7 +35,7 @@ Get-AzRoleEligibilityScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0b .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -56,7 +56,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedulerequest #> function Get-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -77,7 +77,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 index e3031b7d831c..a0e60106503e 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleEligibleChildResource.ps1 @@ -24,49 +24,24 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" Get-AzRoleEligibleChildResource -Scope $scope .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$filter = "resoureType eq 'resourcegroup'" +$filter = "resourceType eq 'resourcegroup'" Get-AzRoleEligibleChildResource -Scope $scope -Filter $filter -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [Id ]: Resource identity path - [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. - [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. - [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. - [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. - [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. - [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. - [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. - [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. - [Scope ]: The scope of the role management policy. +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource .Link https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligiblechildresource #> function Get-AzRoleEligibleChildResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy. ${Scope}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Query')] [System.String] @@ -131,6 +106,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -151,7 +135,6 @@ begin { $mapping = @{ Get = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_Get'; - GetViaIdentity = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_GetViaIdentity'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -160,6 +143,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/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 index e77bd6af2fef..c65c1d27ad4a 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicy.ps1 @@ -30,7 +30,7 @@ Get-AzRoleManagementPolicy -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -51,7 +51,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicy #> function Get-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -131,6 +130,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,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/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 index 9a93332d5a09..91d4db362dc4 100644 --- a/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Get-AzRoleManagementPolicyAssignment.ps1 @@ -30,7 +30,7 @@ Get-AzRoleManagementPolicyAssignment -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Notes COMPLEX PARAMETER PROPERTIES @@ -51,7 +51,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicyassignment #> function Get-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -131,6 +130,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,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/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 index 16ba2a9504ac..853d3268c07a 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleAssignmentScheduleRequest.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates a role assignment schedule request. +Create a role assignment schedule request. .Description -Creates a role assignment schedule request. +Create a role assignment schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -41,12 +41,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType SelfDeactivate -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignmentschedulerequest #> function New-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -65,7 +65,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -73,94 +73,106 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role assignment schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role assignment schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role assignment schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role assignment ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The linked role eligibility schedule id - to activate an eligibility. ${LinkedRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role assignment schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role assignment schedule id or the role assignment schedule id being updated ${TargetRoleAssignmentScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role assignment schedule instance id being updated ${TargetRoleAssignmentScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role assignment ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role assignment ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -217,6 +229,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -237,6 +258,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -245,6 +268,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/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 index cf1964520554..76a75a236437 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleEligibilityScheduleRequest.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Description -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -31,12 +31,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminRemove -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleeligibilityschedulerequest #> function New-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -55,7 +55,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -63,88 +63,100 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role eligibility schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role eligibility schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role eligibility schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role eligibility ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role eligibility schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role eligibility schedule id or the role eligibility schedule id being updated ${TargetRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role eligibility schedule instance id being updated ${TargetRoleEligibilityScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role eligibility ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role eligibility ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -201,6 +213,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -221,6 +242,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -229,6 +252,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/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 index 4ec02b194e7f..18c698e236d1 100644 --- a/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/New-AzRoleManagementPolicyAssignment.ps1 @@ -24,12 +24,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleManagementPolicyAssignment -Scope $scope -Name "0a4d3ef7-147b-4777-a958-ae9dfab3c331" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/new-azrolemanagementpolicyassignment #> function New-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -45,18 +45,30 @@ param( # The scope of the role management policy assignment to upsert. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The policy id role management policy assignment. ${PolicyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition of management policy assignment. ${RoleDefinitionId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -113,6 +125,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -133,6 +154,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -141,6 +164,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/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 index ffe051446715..95f3df1196e8 100644 --- a/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -36,7 +36,7 @@ Get-AzRoleAssignmentScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-969 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -57,7 +57,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentscheduleinstance #> function Get-AzRoleAssignmentScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -147,6 +146,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -177,6 +185,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) @@ -241,7 +252,7 @@ Get-AzRoleAssignmentScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0bc .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -262,7 +273,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedulerequest #> function Get-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -283,7 +294,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -353,6 +363,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -383,6 +402,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) @@ -448,7 +470,7 @@ Get-AzRoleAssignmentSchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708c .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -469,7 +491,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleassignmentschedule #> function Get-AzRoleAssignmentSchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -490,7 +512,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -559,6 +580,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -589,6 +619,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) @@ -654,7 +687,7 @@ Get-AzRoleEligibilityScheduleInstance -Scope $scope -Name "4cd7e26b-8eca-425c-96 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance .Notes COMPLEX PARAMETER PROPERTIES @@ -675,7 +708,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityscheduleinstance #> function Get-AzRoleEligibilityScheduleInstance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -696,7 +729,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -765,6 +797,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -795,6 +836,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) @@ -859,7 +903,7 @@ Get-AzRoleEligibilityScheduleRequest -Scope $scope -Name "2cc018c2-27f8-4730-a0b .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -880,7 +924,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedulerequest #> function Get-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -901,7 +945,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -971,6 +1014,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1001,6 +1053,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) @@ -1066,7 +1121,7 @@ Get-AzRoleEligibilitySchedule -Scope $scope -Name "4cd7e26b-8eca-425c-969d-ec708 .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule .Notes COMPLEX PARAMETER PROPERTIES @@ -1087,7 +1142,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligibilityschedule #> function Get-AzRoleEligibilitySchedule { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1108,7 +1163,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -1177,6 +1231,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1207,6 +1270,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) @@ -1260,49 +1326,24 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" Get-AzRoleEligibleChildResource -Scope $scope .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$filter = "resoureType eq 'resourcegroup'" +$filter = "resourceType eq 'resourcegroup'" Get-AzRoleEligibleChildResource -Scope $scope -Filter $filter -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [Id ]: Resource identity path - [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. - [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. - [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. - [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. - [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. - [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. - [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. - [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. - [Scope ]: The scope of the role management policy. +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource .Link https://learn.microsoft.com/powershell/module/az.resources/get-azroleeligiblechildresource #> function Get-AzRoleEligibleChildResource { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy. ${Scope}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Query')] [System.String] @@ -1367,6 +1408,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1387,7 +1437,6 @@ begin { $mapping = @{ Get = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_Get'; - GetViaIdentity = 'Az.Authorization.private\Get-AzRoleEligibleChildResource_GetViaIdentity'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1396,6 +1445,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) @@ -1455,7 +1507,7 @@ Get-AzRoleManagementPolicyAssignment -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Notes COMPLEX PARAMETER PROPERTIES @@ -1476,7 +1528,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicyassignment #> function Get-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1497,7 +1549,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1556,6 +1607,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1586,6 +1646,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) @@ -1645,7 +1708,7 @@ Get-AzRoleManagementPolicy -Scope $scope -Name $name .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -1666,7 +1729,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.resources/get-azrolemanagementpolicy #> function Get-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1687,7 +1750,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1746,6 +1808,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1776,6 +1847,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) @@ -1821,9 +1895,9 @@ end { <# .Synopsis -Creates a role assignment schedule request. +Create a role assignment schedule request. .Description -Creates a role assignment schedule request. +Create a role assignment schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -1846,12 +1920,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType SelfDeactivate -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleassignmentschedulerequest #> function New-AzRoleAssignmentScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -1870,7 +1944,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -1878,94 +1952,106 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role assignment schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role assignment schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role assignment schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role assignment ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The linked role eligibility schedule id - to activate an eligibility. ${LinkedRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role assignment schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role assignment schedule id or the role assignment schedule id being updated ${TargetRoleAssignmentScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role assignment schedule instance id being updated ${TargetRoleAssignmentScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role assignment ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role assignment ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2022,6 +2108,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2042,6 +2137,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleAssignmentScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2050,6 +2147,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) @@ -2095,9 +2195,9 @@ end { <# .Synopsis -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Description -Creates a role eligibility schedule request. +Create a role eligibility schedule request. .Example $guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" $startTime = Get-Date -Format o @@ -2110,12 +2210,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminRemove -RoleDefinitionId subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest .Link https://learn.microsoft.com/powershell/module/az.resources/new-azroleeligibilityschedulerequest #> function New-AzRoleEligibilityScheduleRequest { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2134,7 +2234,7 @@ param( # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The conditions on the role assignment. @@ -2142,88 +2242,100 @@ param( # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' ${Condition}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Version of the condition. # Currently accepted value is '2.0' ${ConditionVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Duration of the role eligibility schedule in TimeSpan. ${ExpirationDuration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # End DateTime of the role eligibility schedule. ${ExpirationEndDateTime}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type] + [System.String] # Type of the role eligibility schedule expiration ${ExpirationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Justification for the role eligibility ${Justification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The principal ID. ${PrincipalId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType] + [System.String] # The type of the role assignment schedule request. # Eg: SelfActivate, AdminAssign etc ${RequestType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition ID. ${RoleDefinitionId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.DateTime] # Start DateTime of the role eligibility schedule. ${ScheduleInfoStartDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The resultant role eligibility schedule id or the role eligibility schedule id being updated ${TargetRoleEligibilityScheduleId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role eligibility schedule instance id being updated ${TargetRoleEligibilityScheduleInstanceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket number for the role eligibility ${TicketNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # Ticket system name for the role eligibility ${TicketSystem}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2280,6 +2392,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2300,6 +2421,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleEligibilityScheduleRequest_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2308,6 +2431,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) @@ -2361,12 +2487,12 @@ $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" New-AzRoleManagementPolicyAssignment -Scope $scope -Name "0a4d3ef7-147b-4777-a958-ae9dfab3c331" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/new-azrolemanagementpolicyassignment #> function New-AzRoleManagementPolicyAssignment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -2382,18 +2508,30 @@ param( # The scope of the role management policy assignment to upsert. ${Scope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The policy id role management policy assignment. ${PolicyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role definition of management policy assignment. ${RoleDefinitionId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2450,6 +2588,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2470,6 +2617,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.Authorization.private\New-AzRoleManagementPolicyAssignment_CreateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2478,6 +2627,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) @@ -2574,7 +2726,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2639,6 +2790,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2668,6 +2828,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) @@ -2764,7 +2927,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2829,6 +2991,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2858,6 +3029,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) @@ -2955,7 +3129,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3020,6 +3193,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3049,6 +3231,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) @@ -3146,7 +3331,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3211,6 +3395,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3240,6 +3433,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) @@ -3285,61 +3481,19 @@ end { <# .Synopsis -Update a role management policy +Update a role assignment schedule request. .Description -Update a role management policy -.Example -$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ - isExpirationRequired = "false"; - maximumDuration = "P180D"; - id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$rules = [IRoleManagementPolicyRule[]]@($expirationRule) -Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +Update a role assignment schedule request. .Example -$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ - isExpirationRequired = "false"; - maximumDuration = "P180D"; - id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$notificationRule = [RoleManagementPolicyNotificationRule]@{ - notificationType = "Email"; - recipientType = "Approver"; - isDefaultRecipientsEnabled = "false"; - notificationLevel = "Critical"; - notificationRecipient = $null; - id = "Notification_Approver_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); - targetCaller = "Admin"; - targetOperation = @('All'); - targetLevel = "Eligibility"; - targetObject = $null; - targetInheritableSetting = $null; - targetEnforcedSetting = $null; - } -$rules = [IRoleManagementPolicyRule[]]@($expirationRule, $notificationRule) -Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest .Notes COMPLEX PARAMETER PROPERTIES @@ -3356,112 +3510,965 @@ INPUTOBJECT : Identity Parameter [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. [Scope ]: The scope of the role management policy. - -RULE : The rule applied to the policy. - RuleType : The type of rule - [Id ]: The id of the rule. - [TargetCaller ]: The caller of the setting. - [TargetEnforcedSetting ]: The list of enforced settings. - [TargetInheritableSetting ]: The list of inheritable settings. - [TargetLevel ]: The assignment level to which it is applied. - [TargetObject ]: The list of target objects. - [TargetOperation ]: The type of operation. .Link -https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy +https://learn.microsoft.com/powershell/module/az.resources/update-azroleassignmentschedulerequest #> -function Update-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +function Update-AzRoleAssignmentScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('RoleManagementPolicyName')] + [Alias('RoleAssignmentScheduleRequestName')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] - # The name (guid) of the role management policy to upsert. + # The name of the role assignment to create. + # It can be any valid GUID. ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] - # The scope of the role management policy to upsert. + # The scope of the role assignment schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. ${Scope}, [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] - # The role management policy description. - ${Description}, + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] - # The role management policy display name. - ${DisplayName}, + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [System.Management.Automation.SwitchParameter] - # The role management policy is default policy. - ${IsOrganizationDefault}, + [System.String] + # Duration of the role assignment schedule in TimeSpan. + ${ExpirationDuration}, [Parameter()] - [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]] - # The rule applied to the policy. - # To construct, see NOTES section for RULE properties and create a hash table. - ${Rule}, + [System.DateTime] + # End DateTime of the role assignment schedule. + ${ExpirationEndDateTime}, [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role assignment schedule expiration + ${ExpirationType}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role assignment + ${Justification}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The linked role eligibility schedule id - to activate an eligibility. + ${LinkedRoleEligibilityScheduleId}, - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, - [Parameter(DontShow)] + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role assignment schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role assignment schedule id or the role assignment schedule id being updated + ${TargetRoleAssignmentScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role assignment schedule instance id being updated + ${TargetRoleAssignmentScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role assignment + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role assignment + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update a role eligibility schedule request. +.Description +Update a role eligibility schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleeligibilityschedulerequest +#> +function Update-AzRoleEligibilityScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleEligibilityScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role eligibility to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role eligibility schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role eligibility schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role eligibility schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role eligibility schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role eligibility + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role eligibility schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role eligibility schedule id or the role eligibility schedule id being updated + ${TargetRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role eligibility schedule instance id being updated + ${TargetRoleEligibilityScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role eligibility + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role eligibility + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update a role management policy assignment +.Description +Update a role management policy assignment +.Example +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleManagementPolicyAssignment -Scope $scope -Name "11111111-2222-3333-4444-123456789102" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicyassignment +#> +function Update-AzRoleManagementPolicyAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleManagementPolicyAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of format {guid_guid} the role management policy assignment to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy assignment to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The policy id role management policy assignment. + ${PolicyId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition of management policy assignment. + ${RoleDefinitionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update a role management policy +.Description +Update a role management policy +.Example +$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ + isExpirationRequired = "false"; + maximumDuration = "P180D"; + id = "Expiration_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$rules = [IRoleManagementPolicyRule[]]@($expirationRule) +Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules +.Example +$scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ + isExpirationRequired = "false"; + maximumDuration = "P180D"; + id = "Expiration_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$notificationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule]@{ + notificationType = "Email"; + recipientType = "Approver"; + isDefaultRecipientsEnabled = "false"; + notificationLevel = "Critical"; + notificationRecipient = $null; + id = "Notification_Approver_Admin_Eligibility"; + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); + targetCaller = "Admin"; + targetOperation = @('All'); + targetLevel = "Eligibility"; + targetObject = $null; + targetInheritableSetting = $null; + targetEnforcedSetting = $null; + } +$rules = [IRoleManagementPolicyRule[]]@($expirationRule, $notificationRule) +Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. + +RULE : The rule applied to the policy. + RuleType : The type of rule + [Id ]: The id of the rule. + [TargetCaller ]: The caller of the setting. + [TargetEnforcedSetting >]: The list of enforced settings. + [TargetInheritableSetting >]: The list of inheritable settings. + [TargetLevel ]: The assignment level to which it is applied. + [TargetObject >]: The list of target objects. + [TargetOperation >]: The type of operation. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy +#> +function Update-AzRoleManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Alias('RoleManagementPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name (guid) of the role management policy to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role management policy description. + ${Description}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role management policy display name. + ${DisplayName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.Management.Automation.SwitchParameter] + # The role management policy is default policy. + ${IsOrganizationDefault}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[]] + # The rule applied to the policy. + ${Rule}, + + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy @@ -3475,6 +4482,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3496,6 +4512,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3504,6 +4522,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/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 index 6fc7995199d3..1cadc85c0d90 100644 --- a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicy.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -132,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,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/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 index d45eaa7b1505..20eef454f6e0 100644 --- a/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Remove-AzRoleManagementPolicyAssignment.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -132,6 +131,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -161,6 +169,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/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 index d9f880ae00ce..93a9c7a74a41 100644 --- a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleAssignmentScheduleRequest.ps1 @@ -68,7 +68,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,6 +170,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/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 index 4c044ab56360..770efc11e570 100644 --- a/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Stop-AzRoleEligibilityScheduleRequest.ps1 @@ -68,7 +68,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -133,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -162,6 +170,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/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 new file mode 100644 index 000000000000..df05525737e8 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleAssignmentScheduleRequest.ps1 @@ -0,0 +1,311 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update a role assignment schedule request. +.Description +Update a role assignment schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleAssignmentScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleassignmentschedulerequest +#> +function Update-AzRoleAssignmentScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleAssignmentScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role assignment to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role assignment schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role assignment schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role assignment schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role assignment schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role assignment + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The linked role eligibility schedule id - to activate an eligibility. + ${LinkedRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role assignment schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role assignment schedule id or the role assignment schedule id being updated + ${TargetRoleAssignmentScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role assignment schedule instance id being updated + ${TargetRoleAssignmentScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role assignment + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role assignment + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 new file mode 100644 index 000000000000..d05651f74e2f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleEligibilityScheduleRequest.ps1 @@ -0,0 +1,305 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update a role eligibility schedule request. +.Description +Update a role eligibility schedule request. +.Example +$guid = "12f8978c-5d8d-4fbf-b4b6-2f43eeb43eca" +$startTime = Get-Date -Format o +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope -ExpirationDuration PT1H -ExpirationType AfterDuration -PrincipalId 5a4bdd72-ab3e-4d8e-ab0f-8dd8917481a2 -RequestType AdminAssign -RoleDefinitionId subscriptions/11111111-2222-3333-4444-123456789101/providers/Microsoft.Authorization/roleDefinitions/acdd72a7-3385-48ef-bd42-f606fba81ae7 -ScheduleInfoStartDateTime $startTime + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azroleeligibilityschedulerequest +#> +function Update-AzRoleEligibilityScheduleRequest { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleEligibilityScheduleRequestName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of the role eligibility to create. + # It can be any valid GUID. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role eligibility schedule request to create. + # The scope can be any REST resource instance. + # For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The conditions on the role assignment. + # This limits the resources it can be assigned to. + # e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container' + ${Condition}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Version of the condition. + # Currently accepted value is '2.0' + ${ConditionVersion}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Duration of the role eligibility schedule in TimeSpan. + ${ExpirationDuration}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # End DateTime of the role eligibility schedule. + ${ExpirationEndDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Type of the role eligibility schedule expiration + ${ExpirationType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Justification for the role eligibility + ${Justification}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The principal ID. + ${PrincipalId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The type of the role assignment schedule request. + # Eg: SelfActivate, AdminAssign etc + ${RequestType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition ID. + ${RoleDefinitionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.DateTime] + # Start DateTime of the role eligibility schedule. + ${ScheduleInfoStartDateTime}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The resultant role eligibility schedule id or the role eligibility schedule id being updated + ${TargetRoleEligibilityScheduleId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role eligibility schedule instance id being updated + ${TargetRoleEligibilityScheduleInstanceId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket number for the role eligibility + ${TicketNumber}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Ticket system name for the role eligibility + ${TicketSystem}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 index b601d45a19d6..069627bd80bd 100644 --- a/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicy.ps1 @@ -21,11 +21,11 @@ Update a role management policy Update a role management policy .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ isExpirationRequired = "false"; maximumDuration = "P180D"; id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -37,11 +37,11 @@ $rules = [IRoleManagementPolicyRule[]]@($expirationRule) Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588deb8e68e" -Rule $rules .Example $scope = "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" -$expirationRule = [RoleManagementPolicyExpirationRule]@{ +$expirationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyExpirationRule]@{ isExpirationRequired = "false"; maximumDuration = "P180D"; id = "Expiration_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyExpirationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -49,14 +49,14 @@ $expirationRule = [RoleManagementPolicyExpirationRule]@{ targetInheritableSetting = $null; targetEnforcedSetting = $null; } -$notificationRule = [RoleManagementPolicyNotificationRule]@{ +$notificationRule = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyNotificationRule]@{ notificationType = "Email"; recipientType = "Approver"; isDefaultRecipientsEnabled = "false"; notificationLevel = "Critical"; notificationRecipient = $null; id = "Notification_Approver_Admin_Eligibility"; - ruleType = [RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); + ruleType = [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType]("RoleManagementPolicyNotificationRule"); targetCaller = "Admin"; targetOperation = @('All'); targetLevel = "Eligibility"; @@ -70,7 +70,7 @@ Update-AzRoleManagementPolicy -Scope $scope -Name "33b520ea-3544-4abc-8565-3588d .Inputs Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -89,22 +89,24 @@ INPUTOBJECT : Identity Parameter [Scope ]: The scope of the role management policy. RULE : The rule applied to the policy. - RuleType : The type of rule + RuleType : The type of rule [Id ]: The id of the rule. [TargetCaller ]: The caller of the setting. - [TargetEnforcedSetting ]: The list of enforced settings. - [TargetInheritableSetting ]: The list of inheritable settings. + [TargetEnforcedSetting >]: The list of enforced settings. + [TargetInheritableSetting >]: The list of inheritable settings. [TargetLevel ]: The assignment level to which it is applied. - [TargetObject ]: The list of target objects. - [TargetOperation ]: The type of operation. + [TargetObject >]: The list of target objects. + [TargetOperation >]: The type of operation. .Link https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicy #> function Update-AzRoleManagementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('RoleManagementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] @@ -112,6 +114,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [System.String] # The scope of the role management policy to upsert. @@ -121,35 +125,49 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] # 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.Resources.Authorization.Category('Body')] [System.String] # The role management policy description. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.String] # The role management policy display name. ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] [System.Management.Automation.SwitchParameter] # The role management policy is default policy. ${IsOrganizationDefault}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[]] # The rule applied to the policy. - # To construct, see NOTES section for RULE properties and create a hash table. ${Rule}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -206,6 +224,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -227,6 +254,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Authorization.private\Update-AzRoleManagementPolicy_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -235,6 +264,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/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 new file mode 100644 index 000000000000..5b6153f85e5b --- /dev/null +++ b/generated/Resources/Authorization.Autorest/exports/Update-AzRoleManagementPolicyAssignment.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update a role management policy assignment +.Description +Update a role management policy assignment +.Example +$scope = "/subscriptions/11111111-2222-3333-4444-123456789101/" +Update-AzRoleManagementPolicyAssignment -Scope $scope -Name "11111111-2222-3333-4444-123456789102" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [RoleAssignmentScheduleInstanceName ]: The name (hash of schedule name + time) of the role assignment schedule to get. + [RoleAssignmentScheduleName ]: The name (guid) of the role assignment schedule to get. + [RoleAssignmentScheduleRequestName ]: The name of the role assignment to create. It can be any valid GUID. + [RoleEligibilityScheduleInstanceName ]: The name (hash of schedule name + time) of the role eligibility schedule to get. + [RoleEligibilityScheduleName ]: The name (guid) of the role eligibility schedule to get. + [RoleEligibilityScheduleRequestName ]: The name of the role eligibility to create. It can be any valid GUID. + [RoleManagementPolicyAssignmentName ]: The name of format {guid_guid} the role management policy assignment to get. + [RoleManagementPolicyName ]: The name (guid) of the role management policy to get. + [Scope ]: The scope of the role management policy. +.Link +https://learn.microsoft.com/powershell/module/az.resources/update-azrolemanagementpolicyassignment +#> +function Update-AzRoleManagementPolicyAssignment { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('RoleManagementPolicyAssignmentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The name of format {guid_guid} the role management policy assignment to upsert. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [System.String] + # The scope of the role management policy assignment to upsert. + ${Scope}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The policy id role management policy assignment. + ${PolicyId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Body')] + [System.String] + # The role definition of management policy assignment. + ${RoleDefinitionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Authorization.private\Update-AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/generated/Resources/Authorization.Autorest/generate-info.json b/generated/Resources/Authorization.Autorest/generate-info.json index 22aa1aaeab27..7c323249ce95 100644 --- a/generated/Resources/Authorization.Autorest/generate-info.json +++ b/generated/Resources/Authorization.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "8fe8fe69-a25b-4e80-bc00-40fc0d30dab6" + "generate_Id": "8857adb4-91da-4a2d-95e8-717ed4177318" } diff --git a/generated/Resources/Authorization.Autorest/generated/Module.cs b/generated/Resources/Authorization.Autorest/generated/Module.cs index d32f2a1d3337..203a08751993 100644 --- a/generated/Resources/Authorization.Autorest/generated/Module.cs +++ b/generated/Resources/Authorization.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.Resources.Authorization.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Authorization"; + public string Name => @"Az.Resources"; /// 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.Authorization"; + public string ResourceId => @"Az.Resources"; /// 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.Resources.Authorization.Runtime.HttpPi /// 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/Resources/Authorization.Autorest/generated/api/Authorization.cs b/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs index dab79479d127..da378eefa3d1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Authorization.cs @@ -29,7 +29,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EligibleChildResourcesGet(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EligibleChildResourcesGet(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -55,7 +55,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EligibleChildResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.EligibleChildResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -72,7 +72,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task EligibleChildResourcesGetViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task EligibleChildResourcesGetViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -108,11 +108,165 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.EligibleChildResourcesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.EligibleChildResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Get the child resources of a resource on which user has eligible access + /// + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + /// resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter + /// on resource of type = 'Subscription' or 'ResourceGroup' + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 EligibleChildResourcesGetViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/eligibleChildResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/eligibleChildResources'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/eligibleChildResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EligibleChildResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the child resources of a resource on which user has eligible access + /// The scope of the role management policy. + /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + /// resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter + /// on resource of type = 'Subscription' or 'ResourceGroup' + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 EligibleChildResourcesGetWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/eligibleChildResources" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.EligibleChildResourcesGetWithResult_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.Resources.Authorization.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 EligibleChildResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 @@ -122,7 +276,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task EligibleChildResourcesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task EligibleChildResourcesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -133,6 +287,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -140,13 +295,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourcesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -194,7 +349,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet(string scope, string roleAssignmentScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet(string scope, string roleAssignmentScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -219,7 +374,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -233,7 +388,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -269,11 +424,160 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role assignment schedule instance. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleInstancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleInstanceName = _match.Groups["roleAssignmentScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/" + + roleAssignmentScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified role assignment schedule instance. + /// The scope of the role assignments schedules. + /// The name (hash of schedule name + time) of the role assignment schedule + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleInstancesGetWithResult(string scope, string roleAssignmentScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesGetWithResult_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.Resources.Authorization.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 RoleAssignmentScheduleInstancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 @@ -283,7 +587,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -294,6 +598,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -301,13 +606,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -356,7 +661,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -382,7 +687,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -400,7 +705,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -436,47 +741,204 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleInstancesListForScope_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). + /// Gets role assignment schedule instances of a role assignment schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances + /// for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleInstancesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleInstancesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // 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("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedule instances of a role assignment schedule. + /// The scope of the role assignment schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule instances + /// for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleInstancesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleInstancesListForScopeWithResult_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.Resources.Authorization.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 RoleAssignmentScheduleInstancesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleAssignmentScheduleInstancesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -524,7 +986,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel(string scope, string roleAssignmentScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel(string scope, string roleAssignmentScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -550,7 +1012,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); } } @@ -564,7 +1026,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -575,7 +1037,7 @@ public partial class Authorization var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); } // replace URI parameters with values from identity @@ -601,12 +1063,12 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -617,7 +1079,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -628,6 +1090,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -641,7 +1104,7 @@ public partial class Authorization default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -675,7 +1138,7 @@ public partial class Authorization } } - /// Creates a role assignment schedule request. + /// update a role assignment schedule request. /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' @@ -687,10 +1150,11 @@ public partial class Authorization /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsCreate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -715,15 +1179,15 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Creates a role assignment schedule request. + /// update a role assignment schedule request. /// /// Parameters for the role assignment schedule request. /// a delegate that is called when the remote service returns 201 (Created). @@ -731,10 +1195,11 @@ public partial class Authorization /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -770,94 +1235,76 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// 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). + /// update a role assignment schedule request. + /// + /// Parameters for the role assignment schedule request. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// + /// update a role assignment schedule request. /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' /// for a resource. /// The name of the role assignment to create. It can be any valid GUID. - /// Parameters for the role assignment schedule request. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Get the specified role assignment schedule request. - /// The scope of the role assignment schedule request. - /// The name (guid) of the role assignment schedule request to get. - /// a delegate that is called when the remote service returns 200 (OK). + /// Json string supplied to the RoleAssignmentScheduleRequestsCreate operation + /// 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. @@ -865,7 +1312,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet(string scope, string roleAssignmentScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaJsonString(string scope, string roleAssignmentScheduleRequestName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -885,76 +1332,187 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleAssignmentScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Get the specified role assignment schedule request. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role assignment schedule request. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Json string supplied to the RoleAssignmentScheduleRequestsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreateViaJsonStringWithResult(string scope, string roleAssignmentScheduleRequestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" - + roleAssignmentScheduleRequestName + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleAssignmentScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + /// update a role assignment schedule request. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Parameters for the role assignment schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsCreateWithResult(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsCreateWithResult_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.Resources.Authorization.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 RoleAssignmentScheduleRequestsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 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.Resources.Authorization.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 RoleAssignmentScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -965,20 +1523,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -994,31 +1553,72 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// The scope of the role assignment schedule request. - /// The name (guid) of the role assignment schedule request to get. + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role assignment to create. It can be any valid GUID. + /// Parameters for the role assignment schedule request. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsCreate_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets role assignment schedule requests for a scope. - /// The scope of the role assignments schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// Get the specified role assignment schedule request. + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// 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.Resources.Authorization.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 RoleAssignmentScheduleRequestsGet(string scope, string roleAssignmentScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// /// 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). @@ -1027,7 +1627,2209 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleRequestName = _match.Groups["roleAssignmentScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + roleAssignmentScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role assignment schedule request. + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsGetWithResult(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsGetWithResult_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.Resources.Authorization.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 RoleAssignmentScheduleRequestsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleAssignmentScheduleRequestsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role assignment schedule request. + /// The name (guid) of the role assignment schedule request to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsGet_Validate(string scope, string roleAssignmentScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleAssignmentScheduleRequestName),roleAssignmentScheduleRequestName); + } + } + + /// Gets role assignment schedule requests for a scope. + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// 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.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// 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.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedule requests for a scope. + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentScheduleRequestsListForScopeWithResult_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.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleAssignmentScheduleRequestsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope of the role assignments schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the + /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// 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.Resources.Authorization.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 RoleAssignmentSchedulesGet(string scope, string roleAssignmentScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// + /// 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.Resources.Authorization.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 RoleAssignmentSchedulesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + roleAssignmentScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentSchedulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + roleAssignmentScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role assignment schedule for a resource scope + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentSchedulesGetWithResult(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" + + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesGetWithResult_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.Resources.Authorization.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 RoleAssignmentSchedulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleAssignmentSchedulesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The scope of the role assignment schedule. + /// The name (guid) of the role assignment schedule to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Validate(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleAssignmentScheduleName),roleAssignmentScheduleName); + } + } + + /// Gets role assignment schedules for a resource scope. + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// 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.Resources.Authorization.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 RoleAssignmentSchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// 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.Resources.Authorization.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 RoleAssignmentSchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleAssignmentSchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentSchedulesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role assignment schedules for a resource scope. + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentSchedulesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleAssignmentSchedulesListForScopeWithResult_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.Resources.Authorization.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 RoleAssignmentSchedulesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleAssignmentSchedulesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role assignments schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the + /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Gets the specified role eligibility schedule instance. + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleInstancesGet(string scope, string roleEligibilityScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule instance. + /// + /// 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.Resources.Authorization.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 RoleEligibilityScheduleInstancesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + roleEligibilityScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule instance. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleInstancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + roleEligibilityScheduleInstanceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets the specified role eligibility schedule instance. + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleInstancesGetWithResult(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesGetWithResult_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.Resources.Authorization.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 RoleEligibilityScheduleInstancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleEligibilityScheduleInstancesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The scope of the role eligibility schedules. + /// The name (hash of schedule name + time) of the role eligibility schedule + /// to get. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Validate(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleInstanceName),roleEligibilityScheduleInstanceName); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleInstancesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role eligibility schedule instances of a role eligibility schedule. + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleInstancesListForScopeWithResult_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.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The scope of the role eligibility schedule. + /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Cancels a pending role eligibility schedule request. + /// The scope of the role eligibility request to cancel. + /// The name of the role eligibility request to cancel. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleRequestsCancel(string scope, string roleEligibilityScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Cancels a pending role eligibility schedule request. + /// + /// 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.Resources.Authorization.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 RoleEligibilityScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCancel_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The scope of the role eligibility request to cancel. + /// The name of the role eligibility request to cancel. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// + /// Parameters for the role eligibility schedule request. + /// 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.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// + /// Parameters for the role eligibility schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Json string supplied to the RoleEligibilityScheduleRequestsCreate operation + /// 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.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreateViaJsonString(string scope, string roleEligibilityScheduleRequestName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1037,10 +3839,9 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1048,75 +3849,179 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Gets role assignment schedule requests for a scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Json string supplied to the RoleEligibilityScheduleRequestsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaJsonStringWithResult(string scope, string roleEligibilityScheduleRequestName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; + // 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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role eligibility schedule request. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreateWithResult(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsCreateWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleRequestsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 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. @@ -1124,7 +4029,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1135,20 +4040,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1164,31 +4070,33 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// - /// The scope of the role assignments schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role assignment schedule requests created for the - /// current user. Use $filter=asApprover() to return all role assignment schedule requests where the current user is an approver. + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. + /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// The name of the role eligibility to create. It can be any valid GUID. + /// Parameters for the role eligibility schedule request. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get the specified role assignment schedule for a resource scope - /// The scope of the role assignment schedule. - /// The name (guid) of the role assignment schedule to get. + /// Get the specified role eligibility schedule request. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// 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). @@ -1197,7 +4105,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet(string scope, string roleAssignmentScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet(string scope, string roleEligibilityScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1207,8 +4115,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" - + global::System.Uri.EscapeDataString(roleAssignmentScheduleName) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1222,11 +4130,11 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentSchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role assignment schedule for a resource scope + /// Get the specified role eligibility schedule request. /// /// 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 +4144,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1244,21 +4152,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleAssignmentScheduleName = _match.Groups["roleAssignmentScheduleName"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleAssignmentSchedules/" - + roleAssignmentScheduleName + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1272,177 +4180,159 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleAssignmentSchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsGet_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). + /// Get the specified role eligibility schedule request. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleAssignmentSchedulesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The scope of the role assignment schedule. - /// The name (guid) of the role assignment schedule to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesGet_Validate(string scope, string roleAssignmentScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleAssignmentScheduleName),roleAssignmentScheduleName); - } - } - /// Gets role assignment schedules for a resource scope. - /// The scope of the role assignments schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. - /// 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.Resources.Authorization.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 RoleAssignmentSchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + roleEligibilityScheduleRequestName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentSchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsGetWithResult_Call (request, eventListener,sender); } } - /// Gets role assignment schedules for a resource scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. - /// 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). + /// Get the specified role eligibility schedule request. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetWithResult(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleAssignmentSchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleAssignmentSchedules" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleAssignmentSchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsGetWithResult_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.Resources.Authorization.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 RoleEligibilityScheduleRequestsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 @@ -1452,7 +4342,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1463,6 +4353,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1470,13 +4361,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1492,31 +4383,31 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you + /// Validation method for method. Call this like the actual call, but you /// will get validation events back. /// - /// The scope of the role assignments schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules for the - /// current user. Use $filter=asTarget() to return all role assignment schedules created for the current user. + /// The scope of the role eligibility schedule request. + /// The name (guid) of the role eligibility schedule request to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleAssignmentSchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); } } - /// Gets the specified role eligibility schedule instance. - /// The scope of the role eligibility schedules. - /// The name (hash of schedule name + time) of the role eligibility schedule - /// to get. + /// Gets role eligibility schedule requests for a scope. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// 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). @@ -1525,7 +4416,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet(string scope, string roleEligibilityScheduleInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1535,9 +4426,10 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleInstanceName) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1550,12 +4442,17 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the specified role eligibility schedule instance. + /// Gets role eligibility schedule requests for a scope. /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// 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). @@ -1564,7 +4461,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1572,22 +4469,22 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleInstanceName = _match.Groups["roleEligibilityScheduleInstanceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/" - + roleEligibilityScheduleInstanceName + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1600,179 +4497,170 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleInstancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilityScheduleRequestsListForScope_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). + /// Gets role eligibility schedule requests for a scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilityScheduleInstancesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The scope of the role eligibility schedules. - /// The name (hash of schedule name + time) of the role eligibility schedule - /// to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesGet_Validate(string scope, string roleEligibilityScheduleInstanceName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleInstanceName),roleEligibilityScheduleInstanceName); - } - } - /// Gets role eligibility schedule instances of a role eligibility schedule. - /// The scope of the role eligibility schedule. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// 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.Resources.Authorization.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 RoleEligibilityScheduleInstancesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + scope + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsListForScopeWithResult_Call (request, eventListener,sender); } } - /// Gets role eligibility schedule instances of a role eligibility schedule. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// 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). + /// Gets role eligibility schedule requests for a scope. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; + public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + "?" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleInstancesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleEligibilityScheduleRequestsListForScopeWithResult_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.Resources.Authorization.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 RoleEligibilityScheduleRequestsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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). @@ -1783,7 +4671,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1794,6 +4682,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1801,13 +4690,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1823,19 +4712,20 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// - /// The scope of the role eligibility schedule. - /// The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// The scope of the role eligibility schedule requests. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above + /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests + /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the + /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleInstancesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1844,9 +4734,9 @@ public partial class Authorization } } - /// Cancels a pending role eligibility schedule request. - /// The scope of the role eligibility request to cancel. - /// The name of the role eligibility request to cancel. + /// Get the specified role eligibility schedule for a resource scope + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. /// 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). @@ -1855,7 +4745,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel(string scope, string roleEligibilityScheduleRequestName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet(string scope, string roleEligibilityScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1865,9 +4755,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) - + "/cancel" + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1876,16 +4765,16 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Cancels a pending role eligibility schedule request. + /// Get the specified role eligibility schedule for a resource scope /// /// 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 @@ -1895,7 +4784,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancelViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -1903,22 +4792,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName - + "/cancel" + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + roleEligibilityScheduleName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1927,19 +4815,165 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role eligibility schedule for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + roleEligibilityScheduleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role eligibility schedule for a resource scope + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesGetWithResult(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" + + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesGetWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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). @@ -1948,7 +4982,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1959,6 +4993,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1966,13 +5001,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1988,32 +5023,75 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role eligibility request to cancel. - /// The name of the role eligibility request to cancel. + /// The scope of the role eligibility schedule. + /// The name (guid) of the role eligibility schedule to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCancel_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Validate(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(roleEligibilityScheduleName),roleEligibilityScheduleName); } } - /// Creates a role eligibility schedule request. - /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. - /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - /// for a resource. - /// The name of the role eligibility to create. It can be any valid GUID. - /// Parameters for the role eligibility schedule request. - /// a delegate that is called when the remote service returns 201 (Created). + /// Gets role eligibility schedules for a resource scope. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// 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.Resources.Authorization.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 RoleEligibilitySchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleEligibilitySchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role eligibility schedules for a resource scope. + /// + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// 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. @@ -2021,19 +5099,30 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + scope + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2041,31 +5130,28 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleEligibilitySchedulesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Creates a role eligibility schedule request. + /// Gets role eligibility schedules for a resource scope. /// - /// Parameters for the role eligibility schedule request. - /// 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). + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentityWithResult(global::System.String viaIdentity, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2073,47 +5159,147 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleEligibilitySchedulesListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role eligibility schedules for a resource scope. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesListForScopeWithResult(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleRequestsCreate_Call(request,onCreated,onDefault,eventListener,sender); + return await this.RoleEligibilitySchedulesListForScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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. @@ -2121,7 +5307,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2132,20 +5318,21 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Created: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2161,34 +5348,32 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but + /// Validation method for method. Call this like the actual call, but /// you will get validation events back. /// - /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. - /// For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' - /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - /// for a resource. - /// The name of the role eligibility to create. It can be any valid GUID. - /// Parameters for the role eligibility schedule request. + /// The scope of the role eligibility schedules. + /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules + /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the + /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the + /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsCreate_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Get the specified role eligibility schedule request. - /// The scope of the role eligibility schedule request. - /// The name (guid) of the role eligibility schedule request to get. + /// Delete a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2196,7 +5381,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet(string scope, string roleEligibilityScheduleRequestName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete(string scope, string roleManagementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2206,8 +5391,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleRequestName) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2216,18 +5401,19 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get the specified role eligibility schedule request. + /// Delete a role management policy /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2235,7 +5421,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2243,21 +5429,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleRequestName = _match.Groups["roleEligibilityScheduleRequestName"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/" - + roleEligibilityScheduleRequestName + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2266,18 +5452,19 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2285,7 +5472,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2296,6 +5483,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2303,13 +5491,19 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2325,31 +5519,66 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role eligibility schedule request. - /// The name (guid) of the role eligibility schedule request to get. + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsGet_Validate(string scope, string roleEligibilityScheduleRequestName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleRequestName),roleEligibilityScheduleRequestName); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); } } - /// Gets role eligibility schedule requests for a scope. - /// The scope of the role eligibility schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. + /// Get the specified role management policy for a resource scope + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. + /// 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.Resources.Authorization.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 RoleManagementPoliciesGet(string scope, string roleManagementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RoleManagementPoliciesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role management policy for a resource scope + /// /// 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). @@ -2358,20 +5587,30 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2384,26 +5623,19 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilityScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets role eligibility schedule requests for a scope. + /// Get the specified role management policy for a resource scope /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. - /// 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.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2411,42 +5643,140 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilityScheduleRequests$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role management policy for a resource scope + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesGetWithResult(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilityScheduleRequestsListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesGetWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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). @@ -2455,7 +5785,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2466,6 +5796,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2473,13 +5804,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2495,31 +5826,26 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// The scope of the role eligibility schedule requests. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - /// requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests at, above - /// or below the scope for the specified principal. Use $filter=asRequestor() to return all role eligibility schedule requests - /// requested by the current user. Use $filter=asTarget() to return all role eligibility schedule requests created for the - /// current user. Use $filter=asApprover() to return all role eligibility schedule requests where the current user is an approver. + /// The scope of the role management policy. + /// The name (guid) of the role management policy to get. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilityScheduleRequestsListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); } } - /// Get the specified role eligibility schedule for a resource scope - /// The scope of the role eligibility schedule. - /// The name (guid) of the role eligibility schedule to get. + /// Gets role management policies for a resource scope. + /// The scope of the role management policy. /// 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). @@ -2528,7 +5854,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet(string scope, string roleEligibilityScheduleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2538,8 +5864,7 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" - + global::System.Uri.EscapeDataString(roleEligibilityScheduleName) + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2553,11 +5878,11 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilitySchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesListForScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role eligibility schedule for a resource scope + /// Gets role management policies for a resource scope. /// /// 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 @@ -2567,7 +5892,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2575,21 +5900,19 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleEligibilityScheduleName = _match.Groups["roleEligibilityScheduleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleEligibilitySchedules/" - + roleEligibilityScheduleName + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2603,180 +5926,156 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleEligibilitySchedulesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesListForScope_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). + /// Gets role management policies for a resource scope. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleEligibilitySchedulesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The scope of the role eligibility schedule. - /// The name (guid) of the role eligibility schedule to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesGet_Validate(string scope, string roleEligibilityScheduleName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleEligibilityScheduleName),roleEligibilityScheduleName); - } - } - /// Gets role eligibility schedules for a resource scope. - /// The scope of the role eligibility schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// 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.Resources.Authorization.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 RoleEligibilitySchedulesListForScope(string scope, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) - { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + (scope) - + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilitySchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesListForScopeWithResult_Call (request, eventListener,sender); } } - /// Gets role eligibility schedules for a resource scope. - /// - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. - /// 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). + /// Gets role management policies for a resource scope. + /// The scope of the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScopeViaIdentity(global::System.String viaIdentity, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleEligibilitySchedules$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope - + "/providers/Microsoft.Authorization/roleEligibilitySchedules" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicies" + "?" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleEligibilitySchedulesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesListForScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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). @@ -2785,7 +6084,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2796,6 +6095,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2803,13 +6103,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2825,40 +6125,36 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// - /// The scope of the role eligibility schedules. - /// The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedules - /// at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, above or below the - /// scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility schedules for the - /// user. Use $filter=asTarget() to return all role eligibility schedules created for the current user. + /// The scope of the role management policy. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleEligibilitySchedulesListForScope_Validate(string scope, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Delete a role management policy + /// update a role management policy /// The scope of the role management policy to upsert. /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesDelete(string scope, string roleManagementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2878,27 +6174,32 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a role management policy + /// update a role management policy /// + /// Parameters for the role management policy. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -2929,93 +6230,77 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy + /// + /// Parameters for the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + roleManagementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// + /// update a role management policy /// The scope of the role management policy to upsert. /// The name (guid) of the role management policy to upsert. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesDelete_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); - } - } - - /// Get the specified role management policy for a resource scope - /// The scope of the role management policy. - /// The name (guid) of the role management policy to get. + /// Json string supplied to the RoleManagementPoliciesUpdate 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). @@ -3024,7 +6309,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesGet(string scope, string roleManagementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaJsonString(string scope, string roleManagementPolicyName, 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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3044,144 +6329,74 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the specified role management policy for a resource scope - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Json string supplied to the RoleManagementPoliciesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateViaJsonStringWithResult(string scope, string roleManagementPolicyName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); - } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + roleManagementPolicyName + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RoleManagementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPoliciesGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The scope of the role management policy. - /// The name (guid) of the role management policy to get. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesGet_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets role management policies for a resource scope. - /// The scope of the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateWithResult(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3191,73 +6406,92 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleManagementPolicies" + + "/providers/Microsoft.Authorization/roleManagementPolicies/" + + global::System.Uri.EscapeDataString(roleManagementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleManagementPoliciesListForScope_Call(request,onOk,onDefault,eventListener,sender); + return await this.RoleManagementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets role management policies for a resource scope. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScopeViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { - var apiVersion = @"2020-10-01-preview"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + scope - + "/providers/Microsoft.Authorization/roleManagementPolicies" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RoleManagementPoliciesListForScope_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3267,7 +6501,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3278,6 +6512,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3285,13 +6520,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3307,35 +6542,42 @@ public partial class Authorization } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// - /// The scope of the role management policy. + /// The scope of the role management policy to upsert. + /// The name (guid) of the role management policy to upsert. + /// Parameters for the role management policy. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesListForScope_Validate(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(scope),scope); + await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Update a role management policy - /// The scope of the role management policy to upsert. - /// The name (guid) of the role management policy to upsert. - /// Parameters for the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Parameters for the role management policy assignment. + /// 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.Resources.Authorization.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 RoleManagementPoliciesUpdate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3345,8 +6587,8 @@ public partial class Authorization var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + (scope) - + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + global::System.Uri.EscapeDataString(roleManagementPolicyName) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3355,31 +6597,32 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Update a role management policy + /// update a role management policy assignment /// - /// Parameters for the role management policy. - /// a delegate that is called when the remote service returns 200 (OK). + /// Parameters for the role management policy assignment. + /// 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.Resources.Authorization.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 RoleManagementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3387,21 +6630,21 @@ public partial class Authorization { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); } // replace URI parameters with values from identity var scope = _match.Groups["scope"].Value; - var roleManagementPolicyName = _match.Groups["roleManagementPolicyName"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" + scope - + "/providers/Microsoft.Authorization/roleManagementPolicies/" - + roleManagementPolicyName + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3410,95 +6653,78 @@ public partial class Authorization // 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.Resources.Authorization.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// update a role management policy assignment + /// + /// Parameters for the role management policy assignment. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The scope of the role management policy to upsert. - /// The name (guid) of the role management policy to upsert. - /// Parameters for the role management policy. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RoleManagementPoliciesUpdate_Validate(string scope, string roleManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(scope),scope); - await eventListener.AssertNotNull(nameof(roleManagementPolicyName),roleManagementPolicyName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsCreateWithResult_Call (request, eventListener,sender); } } - /// Create a role management policy assignment + /// update a role management policy assignment /// The scope of the role management policy assignment to upsert. /// The name of format {guid_guid} the role management policy assignment /// to upsert. - /// Parameters for the role management policy assignment. + /// Json string supplied to the RoleManagementPolicyAssignmentsCreate operation /// 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). @@ -3507,7 +6733,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaJsonString(string scope, string roleManagementPolicyAssignmentName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3532,71 +6758,167 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsCreate_Call(request,onCreated,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsCreate_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Create a role management policy assignment - /// - /// Parameters for the role management policy assignment. - /// 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). + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Json string supplied to the RoleManagementPolicyAssignmentsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreateViaJsonStringWithResult(string scope, string roleManagementPolicyAssignmentName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var scope = _match.Groups["scope"].Value; - var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // 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.Resources.Authorization.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// update a role management policy assignment + /// The scope of the role management policy assignment to upsert. + /// The name of format {guid_guid} the role management policy assignment + /// to upsert. + /// Parameters for the role management policy assignment. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPolicyAssignmentsCreateWithResult(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/" - + scope + + (scope) + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" - + roleManagementPolicyAssignmentName + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RoleManagementPolicyAssignmentsCreate_Call(request,onCreated,onDefault,eventListener,sender); + return await this.RoleManagementPolicyAssignmentsCreateWithResult_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.Resources.Authorization.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 RoleManagementPolicyAssignmentsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 201 (Created). @@ -3607,7 +6929,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3618,6 +6940,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3625,13 +6948,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3658,7 +6981,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Validate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsCreate_Validate(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3682,7 +7005,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete(string scope, string roleManagementPolicyAssignmentName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete(string scope, string roleManagementPolicyAssignmentName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3707,7 +7030,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -3722,7 +7045,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3758,12 +7081,12 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -3775,7 +7098,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3786,6 +7109,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3805,7 +7129,7 @@ public partial class Authorization default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3852,7 +7176,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet(string scope, string roleManagementPolicyAssignmentName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet(string scope, string roleManagementPolicyAssignmentName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3877,7 +7201,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3891,7 +7215,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGetViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -3927,11 +7251,160 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get the specified role management policy assignment for a resource scope + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPolicyAssignmentsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + var roleManagementPolicyAssignmentName = _match.Groups["roleManagementPolicyAssignmentName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + roleManagementPolicyAssignmentName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the specified role management policy assignment for a resource scope + /// The scope of the role management policy. + /// The name of format {guid_guid} the role management policy assignment + /// to get. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPolicyAssignmentsGetWithResult(string scope, string roleManagementPolicyAssignmentName, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments/" + + global::System.Uri.EscapeDataString(roleManagementPolicyAssignmentName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsGetWithResult_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.Resources.Authorization.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 RoleManagementPolicyAssignmentsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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 @@ -3941,7 +7414,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsGet_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3952,6 +7425,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3959,13 +7433,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4010,7 +7484,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope(string scope, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -4034,7 +7508,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsListForScope_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4048,7 +7522,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScopeViaIdentity(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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { var apiVersion = @"2020-10-01-preview"; // Constant Parameters @@ -4082,12 +7556,156 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RoleManagementPolicyAssignmentsListForScope_Call(request,onOk,onDefault,eventListener,sender); + await this.RoleManagementPolicyAssignmentsListForScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets role management assignment policies for a resource scope. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPolicyAssignmentsListForScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.Authorization/roleManagementPolicyAssignments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments'"); + } + + // replace URI parameters with values from identity + var scope = _match.Groups["scope"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + scope + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsListForScopeWithResult_Call (request, eventListener,sender); + } + } + + /// Gets role management assignment policies for a resource scope. + /// The scope of the role management policy. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 RoleManagementPolicyAssignmentsListForScopeWithResult(string scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + { + var apiVersion = @"2020-10-01-preview"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/" + + (scope) + + "/providers/Microsoft.Authorization/roleManagementPolicyAssignments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RoleManagementPolicyAssignmentsListForScopeWithResult_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.Resources.Authorization.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 RoleManagementPolicyAssignmentsListForScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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). @@ -4098,7 +7716,7 @@ public partial class Authorization /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RoleManagementPolicyAssignmentsListForScope_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.Resources.Authorization.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4109,6 +7727,7 @@ public partial class Authorization await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4116,13 +7735,13 @@ public partial class Authorization case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs deleted file mode 100644 index 764a6ef37119..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.PowerShell.cs +++ /dev/null @@ -1,240 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] - public partial class ExpandedProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExpandedProperties(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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExpandedProperties(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExpandedProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Principal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType, 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 ExpandedProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Principal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); - } - AfterDeserializePSObject(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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] - public partial interface IExpandedProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs deleted file mode 100644 index b6e1672d348b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.PowerShell.cs +++ /dev/null @@ -1,264 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] - public partial class PolicyAssignmentProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PolicyAssignmentProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 PolicyAssignmentProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("RoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("Policy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] - public partial interface IPolicyAssignmentProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs deleted file mode 100644 index bfae1572d12b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.PowerShell.cs +++ /dev/null @@ -1,402 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Assignment schedule - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] - public partial class RoleAssignmentSchedule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentSchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Assignment schedule - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] - public partial interface IRoleAssignmentSchedule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs deleted file mode 100644 index 4636da5850cf..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.PowerShell.cs +++ /dev/null @@ -1,410 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Information about current or upcoming role assignment schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] - public partial class RoleAssignmentScheduleInstance - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Information about current or upcoming role assignment schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] - public partial interface IRoleAssignmentScheduleInstance - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs deleted file mode 100644 index 766a2f8febae..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.PowerShell.cs +++ /dev/null @@ -1,381 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] - public partial class RoleAssignmentScheduleInstanceProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleInstanceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstanceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("OriginRoleAssignmentId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleInstanceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs deleted file mode 100644 index 63fbdf48a965..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.PowerShell.cs +++ /dev/null @@ -1,370 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] - public partial class RoleAssignmentScheduleProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleAssignmentScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("AssignmentType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType?) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs deleted file mode 100644 index 31f242acdac4..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.PowerShell.cs +++ /dev/null @@ -1,474 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Assignment schedule request - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] - public partial class RoleAssignmentScheduleRequest - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Assignment schedule request - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] - public partial interface IRoleAssignmentScheduleRequest - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs deleted file mode 100644 index 0bfe4f1c1bd2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.PowerShell.cs +++ /dev/null @@ -1,445 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role assignment schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] - public partial class RoleAssignmentScheduleRequestProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleAssignmentScheduleRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("LinkedRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role assignment schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] - public partial interface IRoleAssignmentScheduleRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs deleted file mode 100644 index 1162ac715df1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.PowerShell.cs +++ /dev/null @@ -1,386 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] - public partial class RoleEligibilitySchedule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilitySchedule(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] - public partial interface IRoleEligibilitySchedule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs deleted file mode 100644 index 31b4a4fb9fc9..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.PowerShell.cs +++ /dev/null @@ -1,378 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Information about current or upcoming role eligibility schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] - public partial class RoleEligibilityScheduleInstance - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Information about current or upcoming role eligibility schedule instance - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] - public partial interface IRoleEligibilityScheduleInstance - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs deleted file mode 100644 index ebfb94e93efb..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.PowerShell.cs +++ /dev/null @@ -1,349 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] - public partial class RoleEligibilityScheduleInstanceProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleInstanceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstanceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleInstanceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs deleted file mode 100644 index 5a7fc8da4e86..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.PowerShell.cs +++ /dev/null @@ -1,356 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] - public partial class RoleEligibilityScheduleProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RoleEligibilityScheduleRequestId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); - } - if (content.Contains("MemberType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType?) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("StartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UpdatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs deleted file mode 100644 index 3eca8b95fda5..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.PowerShell.cs +++ /dev/null @@ -1,466 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role Eligibility schedule request - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] - public partial class RoleEligibilityScheduleRequest - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role Eligibility schedule request - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] - public partial interface IRoleEligibilityScheduleRequest - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs deleted file mode 100644 index dd3abfc1452a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.PowerShell.cs +++ /dev/null @@ -1,437 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role eligibility schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] - public partial class RoleEligibilityScheduleRequestProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleEligibilityScheduleRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScheduleInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); - } - if (content.Contains("TicketInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType?) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType.CreateFrom); - } - if (content.Contains("RequestType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType.CreateFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status.CreateFrom); - } - if (content.Contains("ApprovalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); - } - if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); - } - if (content.Contains("Justification")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); - } - if (content.Contains("Condition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); - } - if (content.Contains("ConditionVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); - } - if (content.Contains("CreatedOn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RequestorId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("ExpandedPropertyPrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoExpiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); - } - if (content.Contains("ScheduleInfoStartDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); - } - if (content.Contains("TicketInfoTicketNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); - } - if (content.Contains("TicketInfoTicketSystem")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("PrincipalDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); - } - if (content.Contains("PrincipalEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); - } - if (content.Contains("ExpandedPropertiesPrincipalType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); - } - if (content.Contains("ExpirationEndDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpirationDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role eligibility schedule request properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] - public partial interface IRoleEligibilityScheduleRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs deleted file mode 100644 index 10f7827fa22a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.PowerShell.cs +++ /dev/null @@ -1,306 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] - public partial class RoleManagementPolicy - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType, 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 RoleManagementPolicy(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal)this).ScopeType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] - public partial interface IRoleManagementPolicy - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs deleted file mode 100644 index b4bf58f3ee6d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.PowerShell.cs +++ /dev/null @@ -1,258 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] - public partial class RoleManagementPolicyApprovalRule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyApprovalRule(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - if (content.Contains("SettingApprovalMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); - } - if (content.Contains("SettingIsApprovalRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsApprovalRequiredForExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsRequestorJustificationRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingApprovalStage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RoleManagementPolicyApprovalRule(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Setting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - if (content.Contains("SettingApprovalMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); - } - if (content.Contains("SettingIsApprovalRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsApprovalRequiredForExtension")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingIsRequestorJustificationRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SettingApprovalStage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); - } - 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] - public partial interface IRoleManagementPolicyApprovalRule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs deleted file mode 100644 index e403e541e57b..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.PowerShell.cs +++ /dev/null @@ -1,330 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] - public partial class RoleManagementPolicyAssignment - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignment(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] - public partial interface IRoleManagementPolicyAssignment - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs deleted file mode 100644 index 2acbad65ae65..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.PowerShell.cs +++ /dev/null @@ -1,301 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy assignment properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] - public partial class RoleManagementPolicyAssignmentProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyAssignmentProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignmentProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyAssignmentProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("PolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyAssignmentPropertyPolicy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); - } - if (content.Contains("RoleDefinitionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); - } - if (content.Contains("PolicyAssignmentPropertiesPolicyId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); - } - if (content.Contains("PolicyLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyLastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy assignment properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] - public partial interface IRoleManagementPolicyAssignmentProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs deleted file mode 100644 index 394023bc7420..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.PowerShell.cs +++ /dev/null @@ -1,252 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] - public partial class RoleManagementPolicyNotificationRule - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyNotificationRule(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NotificationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism?) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism.CreateFrom); - } - if (content.Contains("NotificationLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel?) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel.CreateFrom); - } - if (content.Contains("RecipientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType?) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType.CreateFrom); - } - if (content.Contains("NotificationRecipient")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (string[]) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IsDefaultRecipientsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RoleManagementPolicyNotificationRule(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NotificationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism?) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism.CreateFrom); - } - if (content.Contains("NotificationLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel?) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel.CreateFrom); - } - if (content.Contains("RecipientType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType?) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType.CreateFrom); - } - if (content.Contains("NotificationRecipient")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (string[]) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IsDefaultRecipientsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("TargetCaller")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); - } - if (content.Contains("TargetOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); - } - if (content.Contains("TargetObject")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetInheritableSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("TargetEnforcedSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("RuleType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// The role management policy rule. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] - public partial interface IRoleManagementPolicyNotificationRule - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs deleted file mode 100644 index 88cece8c2a13..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.PowerShell.cs +++ /dev/null @@ -1,274 +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.Resources.Authorization.Models.Api20201001Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; - - /// Role management policy properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] - public partial class RoleManagementPolicyProperties - { - - /// - /// 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); - - /// - /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RoleManagementPolicyProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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 RoleManagementPolicyProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("IsOrganizationDefault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("LastModifiedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Rule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("EffectiveRule")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[]) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyPropertyScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); - } - if (content.Contains("LastModifiedById")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Role management policy properties with scope. - [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] - public partial interface IRoleManagementPolicyProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.PowerShell.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.PowerShell.cs index 8850320298d5..f406048b5fd7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ApprovalSettings partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,29 +78,29 @@ internal ApprovalSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IsApprovalRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsApprovalRequiredForExtension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsRequestorJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ApprovalMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode = (string) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode, global::System.Convert.ToString); } if (content.Contains("ApprovalStage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.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. @@ -107,51 +115,49 @@ internal ApprovalSettings(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("IsApprovalRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired = (bool?) content.GetValueForProperty("IsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsApprovalRequiredForExtension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("IsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsRequestorJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired = (bool?) content.GetValueForProperty("IsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).IsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ApprovalMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode?) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalMode, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode = (string) content.GetValueForProperty("ApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalMode, global::System.Convert.ToString); } if (content.Contains("ApprovalStage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[]) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("ApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)this).ApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApprovalSettings(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.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApprovalSettings(content); } @@ -161,12 +167,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 approval settings. [System.ComponentModel.TypeConverter(typeof(ApprovalSettingsTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.TypeConverter.cs index 375048951acd..fb2951f965fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs similarity index 77% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs index ac42050924ce..ee63edb6d131 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The approval settings. public partial class ApprovalSettings : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? _approvalMode; + private string _approvalMode; /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get => this._approvalMode; set => this._approvalMode = value; } + public string ApprovalMode { get => this._approvalMode; set => this._approvalMode = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] _approvalStage; + private System.Collections.Generic.List _approvalStage; /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get => this._approvalStage; set => this._approvalStage = value; } + public System.Collections.Generic.List ApprovalStage { get => this._approvalStage; set => this._approvalStage = value; } /// Backing field for property. private bool? _isApprovalRequired; @@ -62,22 +62,32 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"approvalMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string ApprovalMode { get; set; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The approval stages of the request.", SerializedName = @"approvalStages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage) })] + System.Collections.Generic.List ApprovalStage { get; set; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required or not.", SerializedName = @"isApprovalRequired", PossibleTypes = new [] { typeof(bool) })] @@ -86,6 +96,9 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required for assignment extension.", SerializedName = @"isApprovalRequiredForExtension", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +107,9 @@ public partial interface IApprovalSettings : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether requestor justification required.", SerializedName = @"isRequestorJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -105,9 +121,10 @@ internal partial interface IApprovalSettingsInternal { /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? ApprovalMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string ApprovalMode { get; set; } /// The approval stages of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] ApprovalStage { get; set; } + System.Collections.Generic.List ApprovalStage { get; set; } /// Determine whether approval is required or not. bool? IsApprovalRequired { get; set; } /// Determine whether approval is required for assignment extension. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.json.cs similarity index 90% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.json.cs index 82b0e44c7b06..da998af968f8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalSettings.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalSettings.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ApprovalSettings(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authoriza { return; } - {_isApprovalRequired = If( json?.PropertyT("isApprovalRequired"), out var __jsonIsApprovalRequired) ? (bool?)__jsonIsApprovalRequired : IsApprovalRequired;} - {_isApprovalRequiredForExtension = If( json?.PropertyT("isApprovalRequiredForExtension"), out var __jsonIsApprovalRequiredForExtension) ? (bool?)__jsonIsApprovalRequiredForExtension : IsApprovalRequiredForExtension;} - {_isRequestorJustificationRequired = If( json?.PropertyT("isRequestorJustificationRequired"), out var __jsonIsRequestorJustificationRequired) ? (bool?)__jsonIsRequestorJustificationRequired : IsRequestorJustificationRequired;} - {_approvalMode = If( json?.PropertyT("approvalMode"), out var __jsonApprovalMode) ? (string)__jsonApprovalMode : (string)ApprovalMode;} - {_approvalStage = If( json?.PropertyT("approvalStages"), out var __jsonApprovalStages) ? If( __jsonApprovalStages as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalStage.FromJson(__u) )) ))() : null : ApprovalStage;} + {_isApprovalRequired = If( json?.PropertyT("isApprovalRequired"), out var __jsonIsApprovalRequired) ? (bool?)__jsonIsApprovalRequired : _isApprovalRequired;} + {_isApprovalRequiredForExtension = If( json?.PropertyT("isApprovalRequiredForExtension"), out var __jsonIsApprovalRequiredForExtension) ? (bool?)__jsonIsApprovalRequiredForExtension : _isApprovalRequiredForExtension;} + {_isRequestorJustificationRequired = If( json?.PropertyT("isRequestorJustificationRequired"), out var __jsonIsRequestorJustificationRequired) ? (bool?)__jsonIsRequestorJustificationRequired : _isRequestorJustificationRequired;} + {_approvalMode = If( json?.PropertyT("approvalMode"), out var __jsonApprovalMode) ? (string)__jsonApprovalMode : (string)_approvalMode;} + {_approvalStage = If( json?.PropertyT("approvalStages"), out var __jsonApprovalStages) ? If( __jsonApprovalStages as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IApprovalStage) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStage.FromJson(__u) )) ))() : null : _approvalStage;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ApprovalSettings(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.PowerShell.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.PowerShell.cs index 217a950875f0..b1b9f4dd1dcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class ApprovalStage partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,33 +78,33 @@ internal ApprovalStage(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TimeOutInDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IsApproverJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationTimeInMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("PrimaryApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover = (System.Collections.Generic.List) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } if (content.Contains("IsEscalationEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover = (System.Collections.Generic.List) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.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. @@ -111,55 +119,53 @@ internal ApprovalStage(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TimeOutInDay")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay = (int?) content.GetValueForProperty("TimeOutInDay",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).TimeOutInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("IsApproverJustificationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired = (bool?) content.GetValueForProperty("IsApproverJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsApproverJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationTimeInMinute")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute = (int?) content.GetValueForProperty("EscalationTimeInMinute",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationTimeInMinute, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("PrimaryApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover = (System.Collections.Generic.List) content.GetValueForProperty("PrimaryApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).PrimaryApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.ConvertFrom)); } if (content.Contains("IsEscalationEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled = (bool?) content.GetValueForProperty("IsEscalationEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).IsEscalationEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("EscalationApprover")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[]) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover = (System.Collections.Generic.List) content.GetValueForProperty("EscalationApprover",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal)this).EscalationApprover, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSetTypeConverter.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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ApprovalStage(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.Resources.Authorization.Models.Api20201001Preview.IApprovalStage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ApprovalStage(content); } @@ -169,12 +175,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 approval stage. [System.ComponentModel.TypeConverter(typeof(ApprovalStageTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.TypeConverter.cs index c012b84cf350..8a3ccab84730 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IApprovalStage ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.cs similarity index 79% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.cs index a05cf6b8ddcf..edb50e7cf99c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The approval stage. public partial class ApprovalStage : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStageInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStageInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] _escalationApprover; + private System.Collections.Generic.List _escalationApprover; /// The escalation approver of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get => this._escalationApprover; set => this._escalationApprover = value; } + public System.Collections.Generic.List EscalationApprover { get => this._escalationApprover; set => this._escalationApprover = value; } /// Backing field for property. private int? _escalationTimeInMinute; @@ -44,11 +44,11 @@ public partial class ApprovalStage : public bool? IsEscalationEnabled { get => this._isEscalationEnabled; set => this._isEscalationEnabled = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] _primaryApprover; + private System.Collections.Generic.List _primaryApprover; /// The primary approver of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get => this._primaryApprover; set => this._primaryApprover = value; } + public System.Collections.Generic.List PrimaryApprover { get => this._primaryApprover; set => this._primaryApprover = value; } /// Backing field for property. private int? _timeOutInDay; @@ -71,16 +71,22 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The escalation approver of the request.", SerializedName = @"escalationApprovers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) })] + System.Collections.Generic.List EscalationApprover { get; set; } /// /// The time in minutes when the approval request would be escalated if the primary approver does not approves. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time in minutes when the approval request would be escalated if the primary approver does not approves.", SerializedName = @"escalationTimeInMinutes", PossibleTypes = new [] { typeof(int) })] @@ -89,6 +95,9 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approver need to provide justification for his decision.", SerializedName = @"isApproverJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -97,6 +106,9 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value determine whether escalation feature is enabled.", SerializedName = @"isEscalationEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -105,14 +117,20 @@ public partial interface IApprovalStage : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The primary approver of the request.", SerializedName = @"primaryApprovers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet) })] + System.Collections.Generic.List PrimaryApprover { get; set; } /// The time in days when approval request would be timed out. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time in days when approval request would be timed out.", SerializedName = @"approvalStageTimeOutInDays", PossibleTypes = new [] { typeof(int) })] @@ -124,7 +142,7 @@ internal partial interface IApprovalStageInternal { /// The escalation approver of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] EscalationApprover { get; set; } + System.Collections.Generic.List EscalationApprover { get; set; } /// /// The time in minutes when the approval request would be escalated if the primary approver does not approves. /// @@ -134,7 +152,7 @@ internal partial interface IApprovalStageInternal /// The value determine whether escalation feature is enabled. bool? IsEscalationEnabled { get; set; } /// The primary approver of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet[] PrimaryApprover { get; set; } + System.Collections.Generic.List PrimaryApprover { get; set; } /// The time in days when approval request would be timed out. int? TimeOutInDay { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.json.cs similarity index 87% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.json.cs index faf6e6aa356a..7f1eb704fe49 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ApprovalStage.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ApprovalStage.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,23 +65,23 @@ internal ApprovalStage(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorizatio { return; } - {_timeOutInDay = If( json?.PropertyT("approvalStageTimeOutInDays"), out var __jsonApprovalStageTimeOutInDays) ? (int?)__jsonApprovalStageTimeOutInDays : TimeOutInDay;} - {_isApproverJustificationRequired = If( json?.PropertyT("isApproverJustificationRequired"), out var __jsonIsApproverJustificationRequired) ? (bool?)__jsonIsApproverJustificationRequired : IsApproverJustificationRequired;} - {_escalationTimeInMinute = If( json?.PropertyT("escalationTimeInMinutes"), out var __jsonEscalationTimeInMinutes) ? (int?)__jsonEscalationTimeInMinutes : EscalationTimeInMinute;} - {_primaryApprover = If( json?.PropertyT("primaryApprovers"), out var __jsonPrimaryApprovers) ? If( __jsonPrimaryApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet.FromJson(__u) )) ))() : null : PrimaryApprover;} - {_isEscalationEnabled = If( json?.PropertyT("isEscalationEnabled"), out var __jsonIsEscalationEnabled) ? (bool?)__jsonIsEscalationEnabled : IsEscalationEnabled;} - {_escalationApprover = If( json?.PropertyT("escalationApprovers"), out var __jsonEscalationApprovers) ? If( __jsonEscalationApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.UserSet.FromJson(__p) )) ))() : null : EscalationApprover;} + {_timeOutInDay = If( json?.PropertyT("approvalStageTimeOutInDays"), out var __jsonApprovalStageTimeOutInDays) ? (int?)__jsonApprovalStageTimeOutInDays : _timeOutInDay;} + {_isApproverJustificationRequired = If( json?.PropertyT("isApproverJustificationRequired"), out var __jsonIsApproverJustificationRequired) ? (bool?)__jsonIsApproverJustificationRequired : _isApproverJustificationRequired;} + {_escalationTimeInMinute = If( json?.PropertyT("escalationTimeInMinutes"), out var __jsonEscalationTimeInMinutes) ? (int?)__jsonEscalationTimeInMinutes : _escalationTimeInMinute;} + {_primaryApprover = If( json?.PropertyT("primaryApprovers"), out var __jsonPrimaryApprovers) ? If( __jsonPrimaryApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet.FromJson(__u) )) ))() : null : _primaryApprover;} + {_isEscalationEnabled = If( json?.PropertyT("isEscalationEnabled"), out var __jsonIsEscalationEnabled) ? (bool?)__jsonIsEscalationEnabled : _isEscalationEnabled;} + {_escalationApprover = If( json?.PropertyT("escalationApprovers"), out var __jsonEscalationApprovers) ? If( __jsonEscalationApprovers as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IUserSet) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.UserSet.FromJson(__p) )) ))() : null : _escalationApprover;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ApprovalStage(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs index 1d564e3c9330..6b2dcf94a13e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class AuthorizationIdentity 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 . @@ -204,6 +212,18 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(AuthorizationIdentityTypeConverter))] public partial interface IAuthorizationIdentity diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs index 1b33b35103c3..63cb3ab9a85a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.cs @@ -97,6 +97,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +108,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (hash of schedule name + time) of the role assignment schedule to get.", SerializedName = @"roleAssignmentScheduleInstanceName", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +119,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role assignment schedule to get.", SerializedName = @"roleAssignmentScheduleName", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +130,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the role assignment to create. It can be any valid GUID.", SerializedName = @"roleAssignmentScheduleRequestName", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +143,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (hash of schedule name + time) of the role eligibility schedule to get.", SerializedName = @"roleEligibilityScheduleInstanceName", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +154,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role eligibility schedule to get.", SerializedName = @"roleEligibilityScheduleName", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +165,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the role eligibility to create. It can be any valid GUID.", SerializedName = @"roleEligibilityScheduleRequestName", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +176,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of format {guid_guid} the role management policy assignment to get.", SerializedName = @"roleManagementPolicyAssignmentName", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +187,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name (guid) of the role management policy to get.", SerializedName = @"roleManagementPolicyName", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +198,9 @@ public partial interface IAuthorizationIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the role management policy.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs index 934d539f0f3f..a5e396088a9f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/AuthorizationIdentity.json.cs @@ -64,16 +64,16 @@ internal AuthorizationIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleAssignmentScheduleName = If( json?.PropertyT("roleAssignmentScheduleName"), out var __jsonRoleAssignmentScheduleName) ? (string)__jsonRoleAssignmentScheduleName : (string)RoleAssignmentScheduleName;} - {_roleAssignmentScheduleInstanceName = If( json?.PropertyT("roleAssignmentScheduleInstanceName"), out var __jsonRoleAssignmentScheduleInstanceName) ? (string)__jsonRoleAssignmentScheduleInstanceName : (string)RoleAssignmentScheduleInstanceName;} - {_roleAssignmentScheduleRequestName = If( json?.PropertyT("roleAssignmentScheduleRequestName"), out var __jsonRoleAssignmentScheduleRequestName) ? (string)__jsonRoleAssignmentScheduleRequestName : (string)RoleAssignmentScheduleRequestName;} - {_roleEligibilityScheduleName = If( json?.PropertyT("roleEligibilityScheduleName"), out var __jsonRoleEligibilityScheduleName) ? (string)__jsonRoleEligibilityScheduleName : (string)RoleEligibilityScheduleName;} - {_roleEligibilityScheduleInstanceName = If( json?.PropertyT("roleEligibilityScheduleInstanceName"), out var __jsonRoleEligibilityScheduleInstanceName) ? (string)__jsonRoleEligibilityScheduleInstanceName : (string)RoleEligibilityScheduleInstanceName;} - {_roleEligibilityScheduleRequestName = If( json?.PropertyT("roleEligibilityScheduleRequestName"), out var __jsonRoleEligibilityScheduleRequestName) ? (string)__jsonRoleEligibilityScheduleRequestName : (string)RoleEligibilityScheduleRequestName;} - {_roleManagementPolicyName = If( json?.PropertyT("roleManagementPolicyName"), out var __jsonRoleManagementPolicyName) ? (string)__jsonRoleManagementPolicyName : (string)RoleManagementPolicyName;} - {_roleManagementPolicyAssignmentName = If( json?.PropertyT("roleManagementPolicyAssignmentName"), out var __jsonRoleManagementPolicyAssignmentName) ? (string)__jsonRoleManagementPolicyAssignmentName : (string)RoleManagementPolicyAssignmentName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleAssignmentScheduleName = If( json?.PropertyT("roleAssignmentScheduleName"), out var __jsonRoleAssignmentScheduleName) ? (string)__jsonRoleAssignmentScheduleName : (string)_roleAssignmentScheduleName;} + {_roleAssignmentScheduleInstanceName = If( json?.PropertyT("roleAssignmentScheduleInstanceName"), out var __jsonRoleAssignmentScheduleInstanceName) ? (string)__jsonRoleAssignmentScheduleInstanceName : (string)_roleAssignmentScheduleInstanceName;} + {_roleAssignmentScheduleRequestName = If( json?.PropertyT("roleAssignmentScheduleRequestName"), out var __jsonRoleAssignmentScheduleRequestName) ? (string)__jsonRoleAssignmentScheduleRequestName : (string)_roleAssignmentScheduleRequestName;} + {_roleEligibilityScheduleName = If( json?.PropertyT("roleEligibilityScheduleName"), out var __jsonRoleEligibilityScheduleName) ? (string)__jsonRoleEligibilityScheduleName : (string)_roleEligibilityScheduleName;} + {_roleEligibilityScheduleInstanceName = If( json?.PropertyT("roleEligibilityScheduleInstanceName"), out var __jsonRoleEligibilityScheduleInstanceName) ? (string)__jsonRoleEligibilityScheduleInstanceName : (string)_roleEligibilityScheduleInstanceName;} + {_roleEligibilityScheduleRequestName = If( json?.PropertyT("roleEligibilityScheduleRequestName"), out var __jsonRoleEligibilityScheduleRequestName) ? (string)__jsonRoleEligibilityScheduleRequestName : (string)_roleEligibilityScheduleRequestName;} + {_roleManagementPolicyName = If( json?.PropertyT("roleManagementPolicyName"), out var __jsonRoleManagementPolicyName) ? (string)__jsonRoleManagementPolicyName : (string)_roleManagementPolicyName;} + {_roleManagementPolicyAssignmentName = If( json?.PropertyT("roleManagementPolicyAssignmentName"), out var __jsonRoleManagementPolicyAssignmentName) ? (string)__jsonRoleManagementPolicyAssignmentName : (string)_roleManagementPolicyAssignmentName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.PowerShell.cs index 5c83571f6911..2f79b4cd67fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CloudError partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,21 +78,21 @@ internal CloudError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message, 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. @@ -99,43 +107,41 @@ internal CloudError(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBodyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBodyTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal)this).Message, 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.Resources.Authorization.Models.Api20201001Preview.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudError(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.Resources.Authorization.Models.Api20201001Preview.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudError(content); } @@ -145,12 +151,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 error response from the service. [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.TypeConverter.cs index ed48d57ed3f1..c4a507b5f9b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.ICloudError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.cs index 0ca962b5c731..7af0b438872c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// An error response from the service. public partial class CloudError : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal { /// /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody _error; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody _error; /// An error response from the service. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody()); set => this._error = value; } /// /// A message describing the error, intended to be suitable for display in a user interface. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody()); set { {_error = value;} } } /// Creates an new instance. public CloudError() @@ -51,6 +51,9 @@ public partial interface ICloudError : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface ICloudError : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message describing the error, intended to be suitable for display in a user interface.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -76,7 +82,7 @@ internal partial interface ICloudErrorInternal /// string Code { get; set; } /// An error response from the service. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody Error { get; set; } /// /// A message describing the error, intended to be suitable for display in a user interface. /// diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.json.cs index 6bd2e9e7a466..c609b675f324 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudError.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudError.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.R { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.CloudErrorBody.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.CloudErrorBody.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new CloudError(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs similarity index 73% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.PowerShell.cs index 4f10895a14a6..17b617984fdf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,7 +55,15 @@ public partial class CloudErrorBody partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of 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. @@ -70,17 +78,17 @@ internal CloudErrorBody(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message, 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. @@ -95,39 +103,37 @@ internal CloudErrorBody(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal)this).Message, 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.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudErrorBody(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.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudErrorBody(content); } @@ -137,12 +143,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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 error response from the service. [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.TypeConverter.cs index 7362ee3d9e1d..2b275e05a7d9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.cs index 56ff5264d1d1..b1ec3175db29 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// An error response from the service. public partial class CloudErrorBody : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBodyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBodyInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface ICloudErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -57,6 +60,9 @@ public partial interface ICloudErrorBody : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message describing the error, intended to be suitable for display in a user interface.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.json.cs similarity index 95% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.json.cs index 55d5bb4c7e89..ac997a9dbfb7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/CloudErrorBody.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/CloudErrorBody.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorizati { 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;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new CloudErrorBody(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.PowerShell.cs index 0644589258dc..91bcddd7066b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,41 @@ public partial class EligibleChildResource partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EligibleChildResource(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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EligibleChildResource(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +104,21 @@ internal EligibleChildResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)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. @@ -127,15 +133,15 @@ internal EligibleChildResource(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +151,24 @@ internal EligibleChildResource(global::System.Management.Automation.PSObject con /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Eligible child resource [System.ComponentModel.TypeConverter(typeof(EligibleChildResourceTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.TypeConverter.cs index b3bae7099f15..03580cb31ded 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.cs similarity index 87% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.cs index 980ec40ccffa..a7856f185330 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Eligible child resource public partial class EligibleChildResource : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal { /// Backing field for property. @@ -22,13 +22,13 @@ public partial class EligibleChildResource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -60,6 +60,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource scope Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IEligibleChildResource : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.json.cs index 6d996ad89523..c759484c5595 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResource.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal EligibleChildResource(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { return; } - {_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;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new EligibleChildResource(json) : null; } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.PowerShell.cs index 550fd28cefd8..4732ebc37b24 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class EligibleChildResourcesListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EligibleChildResourcesListResult(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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EligibleChildResourcesListResult(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,17 +106,17 @@ internal EligibleChildResourcesListResult(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)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. @@ -123,11 +131,11 @@ internal EligibleChildResourcesListResult(global::System.Management.Automation.P // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -137,12 +145,24 @@ internal EligibleChildResourcesListResult(global::System.Management.Automation.P /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Eligible child resources list operation result. [System.ComponentModel.TypeConverter(typeof(EligibleChildResourcesListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.TypeConverter.cs index 7fa0976ba621..0e658f66f64c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.cs index 2286d794b9ab..db03a16e787a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Eligible child resources list operation result. public partial class EligibleChildResourcesListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class EligibleChildResourcesListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] _value; + private System.Collections.Generic.List _value; /// Eligible child resource list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] 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 EligibleChildResourcesListResult() @@ -41,6 +41,9 @@ public partial interface IEligibleChildResourcesListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 IEligibleChildResourcesListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Eligible child resource list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource) })] + System.Collections.Generic.List Value { get; set; } } /// Eligible child resources list operation result. @@ -62,7 +68,7 @@ internal partial interface IEligibleChildResourcesListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Eligible child resource list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.json.cs index 88e7732e2ddb..b4831ca1239e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/EligibleChildResourcesListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/EligibleChildResourcesListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,19 +65,19 @@ internal EligibleChildResourcesListResult(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.EligibleChildResource.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.Resources.Authorization.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.Resources.Authorization.Models.IEligibleChildResource) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.EligibleChildResource.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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new EligibleChildResourcesListResult(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs new file mode 100644 index 000000000000..87c5099088b4 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.PowerShell.cs @@ -0,0 +1,258 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] + public partial class ExpandedProperties + { + + /// + /// 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.Resources.Authorization.Models.IExpandedProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExpandedProperties(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.Resources.Authorization.Models.IExpandedProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExpandedProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExpandedProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Principal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType, 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 ExpandedProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Principal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("Principal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).Principal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + AfterDeserializePSObject(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.Resources.Authorization.Models.IExpandedProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesTypeConverter))] + public partial interface IExpandedProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.TypeConverter.cs index e99ba506ed37..5358450856fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs index 506f925f13fd..725fbb2f7c2f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.cs @@ -3,84 +3,84 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class ExpandedProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal { /// Internal Acessors for Principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal()); set { {_principal = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal()); set { {_principal = value;} } } /// Internal Acessors for RoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope()); set { {_scope = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal _principal; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal _principal; /// Details of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal()); set => this._principal = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Principal { get => (this._principal = this._principal ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal()); set => this._principal = value; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).DisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).DisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Email = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Email = value ?? null; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Id = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Id = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)Principal).Type = value ?? null; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)Principal).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition _roleDefinition; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition _roleDefinition; /// Details of role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition()); set => this._roleDefinition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition()); set => this._roleDefinition = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope()); set => this._scope = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope()); set => this._scope = value; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).DisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Id = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)Scope).Type = value ?? null; } /// Creates an new instance. public ExpandedProperties() @@ -95,6 +95,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +106,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +117,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +128,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +139,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +150,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -143,6 +161,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +172,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -159,6 +183,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +194,9 @@ public partial interface IExpandedProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -177,7 +207,7 @@ internal partial interface IExpandedPropertiesInternal { /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Principal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Principal { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -187,7 +217,7 @@ internal partial interface IExpandedPropertiesInternal /// Type of the principal string PrincipalType { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition RoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition RoleDefinition { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// Id of the role definition @@ -195,7 +225,7 @@ internal partial interface IExpandedPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.json.cs index 6d7600b20205..43f48ed2edd7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -64,20 +64,20 @@ internal ExpandedProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authori { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesScope.FromJson(__jsonScope) : Scope;} - {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : RoleDefinition;} - {_principal = If( json?.PropertyT("principal"), out var __jsonPrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedPropertiesPrincipal.FromJson(__jsonPrincipal) : Principal;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScope.FromJson(__jsonScope) : _scope;} + {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : _roleDefinition;} + {_principal = If( json?.PropertyT("principal"), out var __jsonPrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipal.FromJson(__jsonPrincipal) : _principal;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedProperties(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.PowerShell.cs index ad4e24cff6fa..2a18664a846e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesPrincipal partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesPrincipal(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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesPrincipal(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,25 +106,25 @@ internal ExpandedPropertiesPrincipal(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)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. @@ -131,19 +139,19 @@ internal ExpandedPropertiesPrincipal(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Email, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -153,12 +161,24 @@ internal ExpandedPropertiesPrincipal(global::System.Management.Automation.PSObje /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of the principal [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesPrincipalTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.TypeConverter.cs index 8f0ca1e74b0b..932056a302c6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.cs index 9c9d4a8f9c4b..ed8464af812c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the principal public partial class ExpandedPropertiesPrincipal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipalInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipalInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IExpandedPropertiesPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.json.cs index dbf52fe471f1..9800a208e1ac 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesPrincipal.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesPrincipal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ExpandedPropertiesPrincipal(Microsoft.Azure.PowerShell.Cmdlets.Resource { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)_email;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesPrincipal(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.PowerShell.cs index 8aa6591b85b4..2bb63fbed21a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesRoleDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesRoleDefinition(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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesRoleDefinition(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +106,21 @@ internal ExpandedPropertiesRoleDefinition(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)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. @@ -127,15 +135,15 @@ internal ExpandedPropertiesRoleDefinition(global::System.Management.Automation.P // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +153,24 @@ internal ExpandedPropertiesRoleDefinition(global::System.Management.Automation.P /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of role definition [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesRoleDefinitionTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.TypeConverter.cs index 22df5c0f2a39..b80ddc075f3d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.cs index e60dadd00955..6e800ccc8cc2 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of role definition public partial class ExpandedPropertiesRoleDefinition : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinitionInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IExpandedPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.json.cs index 053de8935958..ba29a73ea74f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesRoleDefinition.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ExpandedPropertiesRoleDefinition(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesRoleDefinition(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.PowerShell.cs index efa9a0753016..e870efbfa7a0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,35 +55,43 @@ public partial class ExpandedPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpandedPropertiesScope(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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpandedPropertiesScope(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -98,21 +106,21 @@ internal ExpandedPropertiesScope(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)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. @@ -127,15 +135,15 @@ internal ExpandedPropertiesScope(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,12 +153,24 @@ internal ExpandedPropertiesScope(global::System.Management.Automation.PSObject c /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(ExpandedPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.TypeConverter.cs index bb3819c00d13..918c919a5bcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.cs index 027ffd2e29e5..cf3c51b0d8cb 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class ExpandedPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IExpandedPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.json.cs index caeafe4af84a..d1c5c0d70e86 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/ExpandedPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/ExpandedPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ExpandedPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Resources.Au { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new ExpandedPropertiesScope(json) : null; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs new file mode 100644 index 000000000000..380be2019867 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.PowerShell.cs @@ -0,0 +1,284 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] + public partial class PolicyAssignmentProperties + { + + /// + /// 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.Resources.Authorization.Models.IPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PolicyAssignmentProperties(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.Resources.Authorization.Models.IPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PolicyAssignmentProperties(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.Resources.Authorization.Models.IPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PolicyAssignmentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 PolicyAssignmentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("RoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("RoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesTypeConverter))] + public partial interface IPolicyAssignmentProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.TypeConverter.cs index 1e48063c3468..12605c64252e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs index 2a332473a8dc..1069aac54962 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.cs @@ -3,95 +3,107 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class PolicyAssignmentProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal { /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedByType = value ?? null; } /// Internal Acessors for Policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy()); set { {_policy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy()); set { {_policy = value;} } } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedBy = value ?? null /* model class */; } /// Internal Acessors for RoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition()); set { {_roleDefinition = value;} } } /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope()); set { {_scope = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy _policy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy _policy; /// Details of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy()); set => this._policy = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy()); set => this._policy = value; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id = value ?? null; } + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).Id = value ?? null; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)Policy).LastModifiedDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition _roleDefinition; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition _roleDefinition; /// Details of role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition()); set => this._roleDefinition = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get => (this._roleDefinition = this._roleDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition()); set => this._roleDefinition = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).DisplayName = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Id = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)RoleDefinition).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope()); set => this._scope = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope()); set => this._scope = value; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).DisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Id = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)Scope).Type = value ?? null; } /// Creates an new instance. public PolicyAssignmentProperties() @@ -105,39 +117,54 @@ public partial interface IPolicyAssignmentProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -146,6 +173,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -154,6 +184,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -162,6 +195,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +206,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -178,6 +217,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -186,6 +228,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +239,9 @@ public partial interface IPolicyAssignmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -212,15 +260,15 @@ internal partial interface IPolicyAssignmentPropertiesInternal /// Type of principal such as user , group etc string LastModifiedByType { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Policy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Policy { get; set; } /// Id of the policy string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition RoleDefinition { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// Id of the role definition @@ -228,7 +276,7 @@ internal partial interface IPolicyAssignmentPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.json.cs index 048363383df7..53fb48f2fd2e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class PolicyAssignmentProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentProperties(json) : null; } @@ -76,9 +76,9 @@ internal PolicyAssignmentProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesScope.FromJson(__jsonScope) : Scope;} - {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : RoleDefinition;} - {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentPropertiesPolicy.FromJson(__jsonPolicy) : Policy;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScope.FromJson(__jsonScope) : _scope;} + {_roleDefinition = If( json?.PropertyT("roleDefinition"), out var __jsonRoleDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinition.FromJson(__jsonRoleDefinition) : _roleDefinition;} + {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicy.FromJson(__jsonPolicy) : _policy;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.PowerShell.cs index db9339daac4d..ab754300370d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesPolicy partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesPolicy(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesPolicy(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,37 +113,37 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Collections.IDictionary // actually deserialize if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LastModifiedDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedById")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); } if (content.Contains("LastModifiedByDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedByEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,31 +158,31 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Management.Automation.P // actually deserialize if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PrincipalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("LastModifiedDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedById")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); } if (content.Contains("LastModifiedByDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedByEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -183,6 +191,18 @@ internal PolicyAssignmentPropertiesPolicy(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the policy [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesPolicyTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.TypeConverter.cs index bac5f260262a..5cea4a76f218 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.cs index 44a953874015..207600fb72ac 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the policy public partial class PolicyAssignmentPropertiesPolicy : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal { /// Backing field for property. @@ -21,27 +21,27 @@ public partial class PolicyAssignmentPropertiesPolicy : public string Id { get => this._id; set => this._id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal _lastModifiedBy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal _lastModifiedBy; /// The name of the entity last modified it [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; } /// Backing field for property. private global::System.DateTime? _lastModifiedDateTime; @@ -51,7 +51,19 @@ public partial class PolicyAssignmentPropertiesPolicy : public global::System.DateTime? LastModifiedDateTime { get => this._lastModifiedDateTime; set => this._lastModifiedDateTime = value; } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); set { {_lastModifiedBy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); set { {_lastModifiedBy = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicyInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } /// Creates an new instance. public PolicyAssignmentPropertiesPolicy() @@ -67,6 +79,9 @@ public partial interface IPolicyAssignmentPropertiesPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -74,39 +89,54 @@ public partial interface IPolicyAssignmentPropertiesPolicy : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -120,7 +150,7 @@ internal partial interface IPolicyAssignmentPropertiesPolicyInternal /// Id of the policy string Id { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.json.cs index 9f120560b524..83d5233efafc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesPolicy.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesPolicy(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesPolicy(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal.FromJson(__jsonLastModifiedBy) : LastModifiedBy;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : LastModifiedDateTime : LastModifiedDateTime;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal.FromJson(__jsonLastModifiedBy) : _lastModifiedBy;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : _lastModifiedDateTime : _lastModifiedDateTime;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedBy ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._lastModifiedBy.ToJson(null,serializationMode) : null, "lastModifiedBy" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs index 04498caf3b0a..b9b447919d50 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesRoleDefinition partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesRoleDefinition(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesRoleDefinition(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,21 +116,21 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Collections.IDi // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)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. @@ -137,15 +145,15 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Management.Auto // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal PolicyAssignmentPropertiesRoleDefinition(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of role definition [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesRoleDefinitionTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs index a62143b528ba..ca19f968c18c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.cs index a6f7625ac548..e89c85488975 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of role definition public partial class PolicyAssignmentPropertiesRoleDefinition : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinitionInternal { /// Backing field for property. @@ -50,6 +50,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +72,9 @@ public partial interface IPolicyAssignmentPropertiesRoleDefinition : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.json.cs index ab7ded7aefce..d3508f8c867c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesRoleDefinition.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesRoleDefinition.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesRoleDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesRoleDefinition(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesRoleDefinition(Microsoft.Azure.PowerShell.Cmd { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.PowerShell.cs index e0fbd1ddf98b..807c1bbfcbed 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class PolicyAssignmentPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyAssignmentPropertiesScope(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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyAssignmentPropertiesScope(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,21 +113,21 @@ internal PolicyAssignmentPropertiesScope(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)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. @@ -134,15 +142,15 @@ internal PolicyAssignmentPropertiesScope(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal PolicyAssignmentPropertiesScope(global::System.Management.Automation.PS /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(PolicyAssignmentPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.TypeConverter.cs index 88966b72c997..b933ec81d6b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.cs index 0ec0b95ece97..bbb37d6bfe07 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class PolicyAssignmentPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IPolicyAssignmentPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.json.cs index 7c04ab24df06..4c432b764dea 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyAssignmentPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyAssignmentPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyAssignmentPropertiesScope partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyAssignmentPropertiesScope(json) : null; } @@ -77,9 +77,9 @@ internal PolicyAssignmentPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Reso { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.PowerShell.cs index 148f8b97d53e..dd531509d25b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -54,29 +54,35 @@ public partial class PolicyProperties partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyProperties(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.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyProperties(content); } @@ -86,10 +92,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -104,25 +110,25 @@ internal PolicyProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); } if (content.Contains("ScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); } if (content.Contains("ScopeDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); } if (content.Contains("ScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType, 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. @@ -137,19 +143,19 @@ internal PolicyProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScopeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); } if (content.Contains("ScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); } if (content.Contains("ScopeDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); } if (content.Contains("ScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)this).ScopeType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -158,6 +164,18 @@ internal PolicyProperties(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(PolicyPropertiesTypeConverter))] public partial interface IPolicyProperties diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.TypeConverter.cs index 1516c7aad252..760bf1f983d0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs index 8c5646aa7878..b630a4498300 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.cs @@ -3,36 +3,45 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; public partial class PolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal { /// Internal Acessors for Scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope()); set { {_scope = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope()); set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope _scope; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope _scope; /// Details of the resource scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Scope { get => (this._scope = this._scope ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope()); } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).DisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).DisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Id = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Id; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)Scope).Type = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)Scope).Type; } /// Creates an new instance. public PolicyProperties() @@ -46,34 +55,43 @@ public partial interface IPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } internal partial interface IPolicyPropertiesInternal { /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Scope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Scope { get; set; } /// Display name of the resource string ScopeDisplayName { get; set; } /// Scope id of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.json.cs index 3754981320c9..f279d2cbfca8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class PolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyProperties(json) : null; } @@ -76,7 +76,7 @@ internal PolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authoriza { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyPropertiesScope.FromJson(__jsonScope) : Scope;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScope.FromJson(__jsonScope) : _scope;} AfterFromJson(json); } @@ -99,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._scope ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scope.ToJson(null,serializationMode) : null, "scope" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.PowerShell.cs index 9cc271c8d846..4760d7ed06e7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class PolicyPropertiesScope partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PolicyPropertiesScope(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.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PolicyPropertiesScope(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,21 +111,21 @@ internal PolicyPropertiesScope(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)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. @@ -134,15 +140,15 @@ internal PolicyPropertiesScope(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +157,18 @@ internal PolicyPropertiesScope(global::System.Management.Automation.PSObject con /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Details of the resource scope [System.ComponentModel.TypeConverter(typeof(PolicyPropertiesScopeTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.TypeConverter.cs index 8d7b6032ee4b..7b1c73733e60 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.cs index e6af8744bee7..b1f35f7b55ba 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Details of the resource scope public partial class PolicyPropertiesScope : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScopeInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScopeInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IPolicyPropertiesScope : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.json.cs index 10c3f5bf289b..4195e894566e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/PolicyPropertiesScope.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/PolicyPropertiesScope.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PolicyPropertiesScope partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new PolicyPropertiesScope(json) : null; } @@ -77,9 +77,9 @@ internal PolicyPropertiesScope(Microsoft.Azure.PowerShell.Cmdlets.Resources.Auth { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.PowerShell.cs index efa556d15663..219e93fee96d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class Principal partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Principal(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.Resources.Authorization.Models.Api20201001Preview.IPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Principal(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,25 +111,25 @@ internal Principal(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email, 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,19 +144,19 @@ internal Principal(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)this).Email, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +165,18 @@ internal Principal(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 name of the entity last modified it [System.ComponentModel.TypeConverter(typeof(PrincipalTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.TypeConverter.cs index 60e6e4912efa..a4715e8161a8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IPrincipal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.cs index c3712f8b0778..00f082f1491a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The name of the entity last modified it public partial class Principal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IPrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/Principal.json.cs index c62e9521bc45..e623ab49100a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/Principal.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/Principal.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Principal partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new Principal(json) : null; } @@ -77,10 +77,10 @@ internal Principal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Ru { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)_email;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.PowerShell.cs new file mode 100644 index 000000000000..1996aa971f7f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.PowerShell.cs @@ -0,0 +1,420 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Assignment schedule + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] + public partial class RoleAssignmentSchedule + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentSchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentSchedule(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.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role Assignment schedule + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleTypeConverter))] + public partial interface IRoleAssignmentSchedule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.TypeConverter.cs index 7a6be58d560f..308ef69daa3d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs index 47083012c973..6e2a85666eff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Assignment schedule public partial class RoleAssignmentSchedule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal { /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType)""); } + public string AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).AssignmentType = value ?? null; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,37 +24,37 @@ public partial class RoleAssignmentSchedule : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// End DateTime when role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -67,36 +67,36 @@ public partial class RoleAssignmentSchedule : /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -109,37 +109,37 @@ public partial class RoleAssignmentSchedule : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties _property; /// Role assignment schedule properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties()); set => this._property = value; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId = value ?? null; } + public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleAssignmentScheduleRequestId = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -149,47 +149,47 @@ public partial class RoleAssignmentSchedule : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role assignment schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).ScopeType = value ?? null; } /// Start DateTime when role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -202,7 +202,7 @@ public partial class RoleAssignmentSchedule : /// DateTime when role assignment schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } /// Creates an new instance. public RoleAssignmentSchedule() @@ -218,10 +218,14 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -229,6 +233,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -237,6 +244,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -245,6 +255,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -253,6 +266,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role assignment schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -261,6 +277,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -269,6 +288,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -277,6 +299,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -285,6 +310,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +321,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -301,14 +332,21 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -317,6 +355,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -325,6 +366,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -333,6 +377,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -341,16 +388,23 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleAssignmentScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -359,6 +413,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -367,6 +424,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -375,6 +435,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -383,6 +446,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -391,6 +457,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -399,6 +468,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -407,6 +479,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -415,6 +490,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role assignment schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -423,14 +501,21 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -439,6 +524,9 @@ public partial interface IRoleAssignmentSchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -450,7 +538,8 @@ internal partial interface IRoleAssignmentScheduleInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -469,19 +558,20 @@ internal partial interface IRoleAssignmentScheduleInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role assignment schedule Id. string Id { get; set; } /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule string LinkedRoleEligibilityScheduleId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule name. string Name { get; set; } /// Display name of the principal @@ -491,9 +581,10 @@ internal partial interface IRoleAssignmentScheduleInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties Property { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// @@ -515,7 +606,8 @@ internal partial interface IRoleAssignmentScheduleInternal /// Start DateTime when role assignment schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule type. string Type { get; set; } /// DateTime when role assignment schedule was modified diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.json.cs index 59b5e2f2bb45..8afd52da4d31 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentSchedule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentSchedule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentSchedule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentSchedule(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentSchedule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Aut { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.PowerShell.cs index 4a61b02a3b9c..1b1427d1777b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleFilter(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,21 +113,21 @@ internal RoleAssignmentScheduleFilter(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal RoleAssignmentScheduleFilter(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal RoleAssignmentScheduleFilter(global::System.Management.Automation.PSObj /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.TypeConverter.cs index 641a8b03e62c..16cfcc8b5568 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.cs index fd48fc589048..74326730d73c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule filter public partial class RoleAssignmentScheduleFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilterInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IRoleAssignmentScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.json.cs index 5f86bd837e3e..e64276aa453b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleFilter(json) : null; } @@ -77,9 +77,9 @@ internal RoleAssignmentScheduleFilter(Microsoft.Azure.PowerShell.Cmdlets.Resourc { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs new file mode 100644 index 000000000000..2e3db697e938 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.PowerShell.cs @@ -0,0 +1,430 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Information about current or upcoming role assignment schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] + public partial class RoleAssignmentScheduleInstance + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstance(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Information about current or upcoming role assignment schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceTypeConverter))] + public partial interface IRoleAssignmentScheduleInstance + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.TypeConverter.cs index 7d036ecdec6d..5ebbe185790a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs index 94c47b24b700..0134fba36c6b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Information about current or upcoming role assignment schedule instance public partial class RoleAssignmentScheduleInstance : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal { /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType)""); } + public string AssignmentType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).AssignmentType = value ?? null; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,37 +24,37 @@ public partial class RoleAssignmentScheduleInstance : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// The endDateTime of the role assignment schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -67,41 +67,41 @@ public partial class RoleAssignmentScheduleInstance : /// roleEligibilityScheduleId used to activate [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId = value ?? null; } + public string LinkedRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).LinkedRoleEligibilityScheduleInstanceId = value ?? null; } /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -114,35 +114,35 @@ public partial class RoleAssignmentScheduleInstance : /// Role Assignment Id in external system [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string OriginRoleAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId = value ?? null; } + public string OriginRoleAssignmentId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).OriginRoleAssignmentId = value ?? null; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties _property; /// Role assignment schedule instance properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -152,52 +152,52 @@ public partial class RoleAssignmentScheduleInstance : /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId = value ?? null; } + public string RoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleAssignmentScheduleId = value ?? null; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role assignment schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } /// The startDateTime of the role assignment schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role assignment schedule instance. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -221,10 +221,14 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -232,6 +236,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +247,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +258,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -256,6 +269,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role assignment schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -264,6 +280,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +291,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +302,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +313,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +324,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleId used to activate", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +335,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance", SerializedName = @"linkedRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -312,14 +346,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule instance name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -328,6 +369,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role Assignment Id in external system", SerializedName = @"originRoleAssignmentId", PossibleTypes = new [] { typeof(string) })] @@ -336,6 +380,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +391,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +402,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -360,14 +413,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role assignment schedule", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +436,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +447,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +458,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -400,6 +469,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -408,6 +480,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -416,6 +491,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -424,6 +502,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -432,6 +513,9 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role assignment schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -440,14 +524,21 @@ public partial interface IRoleAssignmentScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule instance.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule instance type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule instance type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -459,7 +550,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -478,13 +570,13 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role assignment schedule instance ID. string Id { get; set; } /// roleEligibilityScheduleId used to activate @@ -492,7 +584,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance string LinkedRoleEligibilityScheduleInstanceId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role assignment schedule instance name. string Name { get; set; } /// Role Assignment Id in external system @@ -504,9 +597,10 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule instance properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties Property { get; set; } /// Id of the master role assignment schedule string RoleAssignmentScheduleId { get; set; } /// Display name of the role definition @@ -526,7 +620,8 @@ internal partial interface IRoleAssignmentScheduleInstanceInternal /// The startDateTime of the role assignment schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule instance. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role assignment schedule instance type. string Type { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.json.cs index 766b2ffc06ed..7a778c902b63 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstance.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstance.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstance partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstance(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleInstance(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.PowerShell.cs index d5b07e3816bc..3e8bdce3b8f4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleInstanceFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleInstanceFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleInstanceFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,25 +115,25 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Collections.IDictio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleAssignmentScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, 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. @@ -140,19 +148,19 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Management.Automati // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleAssignmentScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleAssignmentScheduleInstanceFilter(global::System.Management.Automati /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule instance filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs index 5eb09eac3ac6..cc7c349cfe49 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.cs index f19fae2cd367..c4a5d7cb0022 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule instance filter public partial class RoleAssignmentScheduleInstanceFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilterInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -67,6 +70,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances belonging to a specific role assignment schedule.", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +92,9 @@ public partial interface IRoleAssignmentScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.json.cs index 74bba3426a14..a31d7c1abb7c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleInstanceFilter(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)RoleAssignmentScheduleId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)_roleAssignmentScheduleId;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.PowerShell.cs index e6183d351817..93f077ac447d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleInstanceListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleInstanceListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleInstanceListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)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. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleInstanceListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule instance list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstanceListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs index e6aee608c173..9765067969cc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.cs index c767456e6e1e..ab97bf46a876 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule instance list operation result. public partial class RoleAssignmentScheduleInstanceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleInstanceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule instance list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] 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. @@ -43,6 +43,9 @@ public partial interface IRoleAssignmentScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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) })] @@ -51,10 +54,13 @@ public partial interface IRoleAssignmentScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule instance list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule instance list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleAssignmentScheduleInstanceListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule instance list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.json.cs index a0ce042c5dce..6ddd4d04f078 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleInstanceListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleInstance.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleInstance.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs new file mode 100644 index 000000000000..cbc7ad59380a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.PowerShell.cs @@ -0,0 +1,401 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] + public partial class RoleAssignmentScheduleInstanceProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleInstanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleInstanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId = (string) content.GetValueForProperty("RoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("OriginRoleAssignmentId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId = (string) content.GetValueForProperty("OriginRoleAssignmentId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).OriginRoleAssignmentId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).LinkedRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleInstancePropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleInstanceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs index a7538c8785b5..f6f9ee36abab 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.cs similarity index 73% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.cs index 53bd03cbfa7f..2326990893aa 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule properties with scope. public partial class RoleAssignmentScheduleInstanceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? _assignmentType; + private string _assignmentType; /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } + public string AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } /// Backing field for property. private string _condition; @@ -53,22 +53,22 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. private string _linkedRoleEligibilityScheduleId; @@ -87,23 +87,23 @@ public partial class RoleAssignmentScheduleInstanceProperties : public string LinkedRoleEligibilityScheduleInstanceId { get => this._linkedRoleEligibilityScheduleInstanceId; set => this._linkedRoleEligibilityScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Backing field for property. private string _originRoleAssignmentId; @@ -114,11 +114,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -128,11 +128,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Backing field for property. private string _roleAssignmentScheduleId; @@ -143,7 +143,7 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -154,7 +154,7 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _scope; @@ -165,15 +165,15 @@ public partial class RoleAssignmentScheduleInstanceProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -183,11 +183,11 @@ public partial class RoleAssignmentScheduleInstanceProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule instance. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// /// Creates an new instance. @@ -205,10 +205,14 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -216,6 +220,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -224,6 +231,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -232,6 +242,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -240,6 +253,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role assignment schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -248,6 +264,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -256,6 +275,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -264,6 +286,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -272,6 +297,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleId used to activate", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -280,6 +308,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance", SerializedName = @"linkedRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -288,14 +319,21 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Role Assignment Id in external system [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role Assignment Id in external system", SerializedName = @"originRoleAssignmentId", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +342,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -312,6 +353,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -320,6 +364,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -328,14 +375,21 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role assignment schedule", SerializedName = @"roleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +398,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +409,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -360,6 +420,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -368,6 +431,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +442,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +453,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +464,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -400,6 +475,9 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role assignment schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -408,10 +486,14 @@ public partial interface IRoleAssignmentScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule instance.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } /// Role assignment schedule properties with scope. @@ -419,7 +501,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -438,19 +521,20 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// roleEligibilityScheduleId used to activate string LinkedRoleEligibilityScheduleId { get; set; } /// roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance string LinkedRoleEligibilityScheduleInstanceId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Role Assignment Id in external system string OriginRoleAssignmentId { get; set; } /// Display name of the principal @@ -460,7 +544,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Id of the master role assignment schedule string RoleAssignmentScheduleId { get; set; } /// Display name of the role definition @@ -480,7 +565,8 @@ internal partial interface IRoleAssignmentScheduleInstancePropertiesInternal /// The startDateTime of the role assignment schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule instance. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.json.cs index f20591bf853b..126a1b39efa6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleInstanceProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleInstanceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleInstanceProperties(json) : null; } @@ -77,23 +77,23 @@ internal RoleAssignmentScheduleInstanceProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)RoleAssignmentScheduleId;} - {_originRoleAssignmentId = If( json?.PropertyT("originRoleAssignmentId"), out var __jsonOriginRoleAssignmentId) ? (string)__jsonOriginRoleAssignmentId : (string)OriginRoleAssignmentId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_linkedRoleEligibilityScheduleInstanceId = If( json?.PropertyT("linkedRoleEligibilityScheduleInstanceId"), out var __jsonLinkedRoleEligibilityScheduleInstanceId) ? (string)__jsonLinkedRoleEligibilityScheduleInstanceId : (string)LinkedRoleEligibilityScheduleInstanceId;} - {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)AssignmentType;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleAssignmentScheduleId = If( json?.PropertyT("roleAssignmentScheduleId"), out var __jsonRoleAssignmentScheduleId) ? (string)__jsonRoleAssignmentScheduleId : (string)_roleAssignmentScheduleId;} + {_originRoleAssignmentId = If( json?.PropertyT("originRoleAssignmentId"), out var __jsonOriginRoleAssignmentId) ? (string)__jsonOriginRoleAssignmentId : (string)_originRoleAssignmentId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_linkedRoleEligibilityScheduleInstanceId = If( json?.PropertyT("linkedRoleEligibilityScheduleInstanceId"), out var __jsonLinkedRoleEligibilityScheduleInstanceId) ? (string)__jsonLinkedRoleEligibilityScheduleInstanceId : (string)_linkedRoleEligibilityScheduleInstanceId;} + {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)_assignmentType;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.PowerShell.cs index 8574f3658e5a..d0fe750925f8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleListResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,17 +113,17 @@ internal RoleAssignmentScheduleListResult(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)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. @@ -130,11 +138,11 @@ internal RoleAssignmentScheduleListResult(global::System.Management.Automation.P // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal RoleAssignmentScheduleListResult(global::System.Management.Automation.P /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.TypeConverter.cs index d6c005506bf5..0dbc3bb8e96f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.cs index b9b291df372c..f96bc511b8df 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule list operation result. public partial class RoleAssignmentScheduleListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] 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 RoleAssignmentScheduleListResult() @@ -41,6 +41,9 @@ public partial interface IRoleAssignmentScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 IRoleAssignmentScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleAssignmentScheduleListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.json.cs index 610e5827be00..0da1eb4899d7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleListResult(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentSchedule.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentSchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentSchedule.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs new file mode 100644 index 000000000000..2992fca86d9c --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.PowerShell.cs @@ -0,0 +1,390 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] + public partial class RoleAssignmentScheduleProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleAssignmentScheduleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleAssignmentScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId = (string) content.GetValueForProperty("RoleAssignmentScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleAssignmentScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("AssignmentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType = (string) content.GetValueForProperty("AssignmentType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).AssignmentType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentSchedulePropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.TypeConverter.cs index 1a51e939bd63..91273fe7e889 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.cs similarity index 72% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.cs index 279e8456cba5..fca9bbc4b4a1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule properties with scope. public partial class RoleAssignmentScheduleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? _assignmentType; + private string _assignmentType; /// Assignment type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } + public string AssignmentType { get => this._assignmentType; set => this._assignmentType = value; } /// Backing field for property. private string _condition; @@ -53,22 +53,22 @@ public partial class RoleAssignmentScheduleProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. private string _linkedRoleEligibilityScheduleId; @@ -78,31 +78,31 @@ public partial class RoleAssignmentScheduleProperties : public string LinkedRoleEligibilityScheduleId { get => this._linkedRoleEligibilityScheduleId; set => this._linkedRoleEligibilityScheduleId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -112,11 +112,11 @@ public partial class RoleAssignmentScheduleProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Backing field for property. private string _roleAssignmentScheduleRequestId; @@ -129,7 +129,7 @@ public partial class RoleAssignmentScheduleProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -140,7 +140,7 @@ public partial class RoleAssignmentScheduleProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _scope; @@ -151,15 +151,15 @@ public partial class RoleAssignmentScheduleProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -169,11 +169,11 @@ public partial class RoleAssignmentScheduleProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private global::System.DateTime? _updatedOn; @@ -196,10 +196,14 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Assignment type of the role assignment schedule", SerializedName = @"assignmentType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -207,6 +211,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +222,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -223,6 +233,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -231,6 +244,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role assignment schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -239,6 +255,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -247,6 +266,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -255,6 +277,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -263,6 +288,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -271,14 +299,21 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role assignment schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +322,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -295,6 +333,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -303,16 +344,23 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleAssignmentScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -321,6 +369,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -329,6 +380,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -337,6 +391,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -345,6 +402,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -353,6 +413,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -361,6 +424,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -369,6 +435,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -377,6 +446,9 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role assignment schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -385,14 +457,21 @@ public partial interface IRoleAssignmentScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role assignment schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role assignment schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role assignment schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -404,7 +483,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal { /// Assignment type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType? AssignmentType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Activated", "Assigned")] + string AssignmentType { get; set; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] /// StringEqualsIgnoreCase 'foo_storage_container' @@ -423,17 +503,18 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule string LinkedRoleEligibilityScheduleId { get; set; } /// Membership type of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -441,7 +522,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule /// @@ -463,7 +545,8 @@ internal partial interface IRoleAssignmentSchedulePropertiesInternal /// Start DateTime when role assignment schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role assignment schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role assignment schedule was modified global::System.DateTime? UpdatedOn { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.json.cs index 58fc49c398fa..063f17766a04 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleProperties(json) : null; } @@ -77,22 +77,22 @@ internal RoleAssignmentScheduleProperties(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleAssignmentScheduleRequestId = If( json?.PropertyT("roleAssignmentScheduleRequestId"), out var __jsonRoleAssignmentScheduleRequestId) ? (string)__jsonRoleAssignmentScheduleRequestId : (string)RoleAssignmentScheduleRequestId;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)AssignmentType;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : UpdatedOn : UpdatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleAssignmentScheduleRequestId = If( json?.PropertyT("roleAssignmentScheduleRequestId"), out var __jsonRoleAssignmentScheduleRequestId) ? (string)__jsonRoleAssignmentScheduleRequestId : (string)_roleAssignmentScheduleRequestId;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_assignmentType = If( json?.PropertyT("assignmentType"), out var __jsonAssignmentType) ? (string)__jsonAssignmentType : (string)_assignmentType;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : _updatedOn : _updatedOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs new file mode 100644 index 000000000000..89581bd2c59f --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.PowerShell.cs @@ -0,0 +1,494 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Assignment schedule request + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] + public partial class RoleAssignmentScheduleRequest + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequest(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role Assignment schedule request + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestTypeConverter))] + public partial interface IRoleAssignmentScheduleRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.TypeConverter.cs index 3ba5876a023b..7bb81b3dd7be 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs index 4543f7bc7ffd..5f89ba6d7330 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Assignment schedule request public partial class RoleAssignmentScheduleRequest : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal { /// The approvalId of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; } + public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,47 +24,47 @@ public partial class RoleAssignmentScheduleRequest : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role assignment schedule request was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? null; } /// Backing field for property. private string _id; @@ -77,63 +77,93 @@ public partial class RoleAssignmentScheduleRequest : /// Justification for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } + public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } /// The linked role eligibility schedule id - to activate an eligibility. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } + public string LinkedRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).LinkedRoleEligibilityScheduleId = value ?? null; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ApprovalId = value ?? null; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties()); set { {_property = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId = value ?? null; } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfo = value ?? null /* model class */; } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status = value ?? null; } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfo = value ?? null /* model class */; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -146,42 +176,42 @@ public partial class RoleAssignmentScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalEmail; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).PrincipalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties _property; /// Role assignment schedule request properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties()); set => this._property = value; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); } + public string RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestType = value ?? null; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; } + public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RequestorId; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -191,69 +221,69 @@ public partial class RoleAssignmentScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).RoleDefinitionType; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } /// The role assignment schedule request scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).ScopeType; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).Status; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId = value ?? null; } + public string TargetRoleAssignmentScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleId = value ?? null; } /// The role assignment schedule instance id being updated [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleAssignmentScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId = value ?? null; } + public string TargetRoleAssignmentScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TargetRoleAssignmentScheduleInstanceId = value ?? null; } /// Ticket number for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } /// Ticket system name for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } /// Backing field for property. private string _type; @@ -277,6 +307,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role assignment schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -288,6 +321,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -296,6 +332,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -304,6 +343,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role assignment schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -311,31 +353,43 @@ public partial interface IRoleAssignmentScheduleRequest : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +398,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -352,14 +409,21 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role assignment schedule request ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -368,6 +432,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role assignment", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +443,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linked role eligibility schedule id - to activate an eligibility.", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +454,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -391,23 +464,32 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -416,24 +498,35 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -441,15 +534,21 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -457,15 +556,21 @@ public partial interface IRoleAssignmentScheduleRequest : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -474,6 +579,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -481,41 +589,57 @@ public partial interface IRoleAssignmentScheduleRequest : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role assignment schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", SerializedName = @"targetRoleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -524,6 +648,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule instance id being updated", SerializedName = @"targetRoleAssignmentScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -532,6 +659,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -540,6 +670,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -548,6 +681,9 @@ public partial interface IRoleAssignmentScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -576,19 +712,20 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role assignment schedule request ID. string Id { get; set; } /// Justification for the role assignment @@ -604,13 +741,15 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role assignment schedule request properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties Property { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -620,9 +759,9 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role assignment schedule request scope. @@ -634,7 +773,8 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role assignment schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// @@ -642,7 +782,7 @@ internal partial interface IRoleAssignmentScheduleRequestInternal /// The role assignment schedule instance id being updated string TargetRoleAssignmentScheduleInstanceId { get; set; } /// Ticket Info of the role assignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role assignment string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role assignment diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.json.cs index 5c3fcd5451f7..aa6e555acf18 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequest.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequest.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequest(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleRequest(Microsoft.Azure.PowerShell.Cmdlets.Resour { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.PowerShell.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.PowerShell.cs index 43761e1d24b6..a8b42e2d2b31 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,25 +115,25 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Collections.IDiction // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status, 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. @@ -140,19 +148,19 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Management.Automatio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleAssignmentScheduleRequestFilter(global::System.Management.Automatio /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule request filter [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.TypeConverter.cs index f2a422e72899..4842c87ed959 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.cs index 02b948ec2df2..3acc29354ed1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request filter public partial class RoleAssignmentScheduleRequestFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilterInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests created by specific principal.", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IRoleAssignmentScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role assignment requests of specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.json.cs index 5b00e31a7849..58b6d6de0766 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleAssignmentScheduleRequestFilter(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.PowerShell.cs index b7af05198cf4..98f5843b901b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Collections.IDic // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)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. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Management.Autom // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleRequestListResult(global::System.Management.Autom /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role assignment schedule request list operation result. [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.TypeConverter.cs index 866cf4db01c7..e34ef00fd8c6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.cs index 34d93c892333..f51183b9e85b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request list operation result. public partial class RoleAssignmentScheduleRequestListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleAssignmentScheduleRequestListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] _value; + private System.Collections.Generic.List _value; /// Role assignment schedule request list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] 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 RoleAssignmentScheduleRequestListResult() @@ -41,6 +41,9 @@ public partial interface IRoleAssignmentScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 IRoleAssignmentScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role assignment schedule request list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest) })] + System.Collections.Generic.List Value { get; set; } } /// Role assignment schedule request list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleAssignmentScheduleRequestListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role assignment schedule request list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.json.cs index 6aa0fc3eac9a..8b8d67837012 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleAssignmentScheduleRequestListResult(Microsoft.Azure.PowerShell.Cmdl { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..56cb8cccd832 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.PowerShell.cs @@ -0,0 +1,465 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role assignment schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] + public partial class RoleAssignmentScheduleRequestProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleAssignmentScheduleRequestProperties(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.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleAssignmentScheduleRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleAssignmentScheduleRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleAssignmentScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleAssignmentScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TargetRoleAssignmentScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("LinkedRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId = (string) content.GetValueForProperty("LinkedRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).LinkedRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role assignment schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTypeConverter))] + public partial interface IRoleAssignmentScheduleRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.TypeConverter.cs index ac5f5de46335..cbc9518b93b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.cs similarity index 62% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.cs index ab748edbfd9c..5573d68c998d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role assignment schedule request properties with scope. public partial class RoleAssignmentScheduleRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal { /// Backing field for property. @@ -46,34 +46,34 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? null; } /// Backing field for property. private string _justification; @@ -90,51 +90,81 @@ public partial class RoleAssignmentScheduleRequestProperties : public string LinkedRoleEligibilityScheduleId { get => this._linkedRoleEligibilityScheduleId; set => this._linkedRoleEligibilityScheduleId = value; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; } /// Backing field for property. private string _principalId; @@ -144,20 +174,20 @@ public partial class RoleAssignmentScheduleRequestProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; } + public string PrincipalType { get => this._principalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType _requestType; + private string _requestType; /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => this._requestType; set => this._requestType = value; } + public string RequestType { get => this._requestType; set => this._requestType = value; } /// Backing field for property. private string _requestorId; @@ -168,7 +198,7 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -179,18 +209,18 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo _scheduleInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo _scheduleInfo; /// Schedule info of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private string _scope; @@ -201,22 +231,22 @@ public partial class RoleAssignmentScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _targetRoleAssignmentScheduleId; @@ -237,19 +267,19 @@ public partial class RoleAssignmentScheduleRequestProperties : public string TargetRoleAssignmentScheduleInstanceId { get => this._targetRoleAssignmentScheduleInstanceId; set => this._targetRoleAssignmentScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo _ticketInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo _ticketInfo; /// Ticket Info of the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } /// Ticket number for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } /// Ticket system name for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } /// Creates an new instance. public RoleAssignmentScheduleRequestProperties() @@ -265,6 +295,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role assignment schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -276,6 +309,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -284,6 +320,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -292,6 +331,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role assignment schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -299,31 +341,43 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -332,6 +386,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -340,14 +397,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role assignment [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role assignment", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +420,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The linked role eligibility schedule id - to activate an eligibility.", SerializedName = @"linkedRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -363,23 +430,32 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -388,24 +464,35 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -413,15 +500,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -429,15 +522,21 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -446,6 +545,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role assignment schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -453,41 +555,57 @@ public partial interface IRoleAssignmentScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role assignment schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role assignment schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", SerializedName = @"targetRoleAssignmentScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -496,6 +614,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role assignment schedule instance id being updated", SerializedName = @"targetRoleAssignmentScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -504,6 +625,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -512,6 +636,9 @@ public partial interface IRoleAssignmentScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -540,19 +667,20 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role assignment string Justification { get; set; } /// The linked role eligibility schedule id - to activate an eligibility. @@ -564,11 +692,13 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -578,9 +708,9 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role assignment schedule request scope. @@ -592,7 +722,8 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role assignment schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role assignment schedule id or the role assignment schedule id being updated /// @@ -600,7 +731,7 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesInternal /// The role assignment schedule instance id being updated string TargetRoleAssignmentScheduleInstanceId { get; set; } /// Ticket Info of the role assignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role assignment string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role assignment diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.json.cs index f04c360bb536..04e177588520 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestProperties(json) : null; } @@ -77,24 +77,24 @@ internal RoleAssignmentScheduleRequestProperties(Microsoft.Azure.PowerShell.Cmdl { return; } - {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : ScheduleInfo;} - {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : TicketInfo;} - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)RequestType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)ApprovalId;} - {_targetRoleAssignmentScheduleId = If( json?.PropertyT("targetRoleAssignmentScheduleId"), out var __jsonTargetRoleAssignmentScheduleId) ? (string)__jsonTargetRoleAssignmentScheduleId : (string)TargetRoleAssignmentScheduleId;} - {_targetRoleAssignmentScheduleInstanceId = If( json?.PropertyT("targetRoleAssignmentScheduleInstanceId"), out var __jsonTargetRoleAssignmentScheduleInstanceId) ? (string)__jsonTargetRoleAssignmentScheduleInstanceId : (string)TargetRoleAssignmentScheduleInstanceId;} - {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)LinkedRoleEligibilityScheduleId;} - {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)Justification;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} + {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : _scheduleInfo;} + {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : _ticketInfo;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)_requestType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)_approvalId;} + {_targetRoleAssignmentScheduleId = If( json?.PropertyT("targetRoleAssignmentScheduleId"), out var __jsonTargetRoleAssignmentScheduleId) ? (string)__jsonTargetRoleAssignmentScheduleId : (string)_targetRoleAssignmentScheduleId;} + {_targetRoleAssignmentScheduleInstanceId = If( json?.PropertyT("targetRoleAssignmentScheduleInstanceId"), out var __jsonTargetRoleAssignmentScheduleInstanceId) ? (string)__jsonTargetRoleAssignmentScheduleInstanceId : (string)_targetRoleAssignmentScheduleInstanceId;} + {_linkedRoleEligibilityScheduleId = If( json?.PropertyT("linkedRoleEligibilityScheduleId"), out var __jsonLinkedRoleEligibilityScheduleId) ? (string)__jsonLinkedRoleEligibilityScheduleId : (string)_linkedRoleEligibilityScheduleId;} + {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)_justification;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} AfterFromJson(json); } @@ -121,26 +121,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } AddIf( null != this._scheduleInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scheduleInfo.ToJson(null,serializationMode) : null, "scheduleInfo" ,container.Add ); AddIf( null != this._ticketInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._ticketInfo.ToJson(null,serializationMode) : null, "ticketInfo" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expandedProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._expandedProperty.ToJson(null,serializationMode) : null, "expandedProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._roleDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._roleDefinitionId.ToString()) : null, "roleDefinitionId" ,container.Add ); AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalType.ToString()) : null, "principalType" ,container.Add ); } AddIf( null != (((object)this._requestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestType.ToString()) : null, "requestType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._approvalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._approvalId.ToString()) : null, "approvalId" ,container.Add ); } @@ -150,11 +150,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J AddIf( null != (((object)this._justification)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._justification.ToString()) : null, "justification" ,container.Add ); AddIf( null != (((object)this._condition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._condition.ToString()) : null, "condition" ,container.Add ); AddIf( null != (((object)this._conditionVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._conditionVersion.ToString()) : null, "conditionVersion" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._createdOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._requestorId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestorId.ToString()) : null, "requestorId" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs index 4aa554859bf7..5fd6603016cc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfo(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,29 +116,29 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Coll // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, 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. @@ -145,23 +153,23 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Mana // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -170,6 +178,18 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(global::System.Mana /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Schedule info of the role assignment schedule [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesScheduleInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs index 6c5eb923551c..807f69a4764b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs index 165dc3c81ab9..1d6df57ee420 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Schedule info of the role assignment schedule public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration _expiration; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration _expiration; /// Expiration of the role assignment schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } /// Duration of the role assignment schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } /// End DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? null; } /// Internal Acessors for Expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -58,6 +58,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -74,14 +80,21 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role assignment schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role assignment schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -93,13 +106,14 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoI { /// Expiration of the role assignment schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } /// Duration of the role assignment schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role assignment schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role assignment schedule. global::System.DateTime? StartDateTime { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs index 07ce83d1bd22..dccf8036c703 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesScheduleInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfo(Microsoft.Azure.Pow { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : Expiration;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : _expiration;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs index 717d988ca5b3..4d936978e816 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,21 +116,21 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, 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. @@ -137,15 +145,15 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(global::S /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Expiration of the role assignment schedule [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs index 24e1344a1c47..64ef0384853d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is /// no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs similarity index 82% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs index 39baa9db2628..6c2bc953272f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Expiration of the role assignment schedule public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpirationInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati public global::System.DateTime? EndDateTime { get => this._endDateTime; set => this._endDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? _type; + private string _type; /// Type of the role assignment schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// /// Creates an new instance. @@ -50,6 +50,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role assignment schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role assignment schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,10 +72,14 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoExp [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } /// Expiration of the role assignment schedule @@ -81,7 +91,8 @@ internal partial interface IRoleAssignmentScheduleRequestPropertiesScheduleInfoE /// End DateTime of the role assignment schedule. global::System.DateTime? EndDateTime { get; set; } /// Type of the role assignment schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs index f3f6832505bb..cef2548e60d7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpirati partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(json) : null; } @@ -78,9 +78,9 @@ internal RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration(Microsoft { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)Duration;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)_duration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs index a8c6984748be..4bed6e5f5bc6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleAssignmentScheduleRequestPropertiesTicketInfo(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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleAssignmentScheduleRequestPropertiesTicketInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Collec // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, 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. @@ -133,11 +141,11 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Manage // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(global::System.Manage /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Ticket Info of the role assignment [System.ComponentModel.TypeConverter(typeof(RoleAssignmentScheduleRequestPropertiesTicketInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs index bef679bcab83..05a17a3ab20c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs index f74411f22c33..617930757eb7 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Ticket Info of the role assignment public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfoInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role assignment", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IRoleAssignmentScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role assignment", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs index 677d87f7e81f..6f2153230290 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleAssignmentScheduleRequestPropertiesTicketInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleAssignmentScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleAssignmentScheduleRequestPropertiesTicketInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleAssignmentScheduleRequestPropertiesTicketInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleAssignmentScheduleRequestPropertiesTicketInfo(Microsoft.Azure.Power { return; } - {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)TicketNumber;} - {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)TicketSystem;} + {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)_ticketNumber;} + {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)_ticketSystem;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.cs new file mode 100644 index 000000000000..7c6a7753b6ca --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.PowerShell.cs @@ -0,0 +1,406 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] + public partial class RoleEligibilitySchedule + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilitySchedule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilitySchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilitySchedule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilitySchedule(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.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedulePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId = (string) content.GetValueForProperty("RequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RequestId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleTypeConverter))] + public partial interface IRoleEligibilitySchedule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.TypeConverter.cs index 3b99ee7a8dec..3f19f3ae0c22 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.cs index bbb292bf84c0..7360b44f4061 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule public partial class RoleEligibilitySchedule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal { /// @@ -19,37 +19,37 @@ public partial class RoleEligibilitySchedule : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// End DateTime when role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -62,31 +62,31 @@ public partial class RoleEligibilitySchedule : /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -99,37 +99,37 @@ public partial class RoleEligibilitySchedule : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties _property; /// role eligibility schedule properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties()); set => this._property = value; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId = value ?? null; } + public string RequestId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleEligibilityScheduleRequestId = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -139,47 +139,47 @@ public partial class RoleEligibilitySchedule : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// The role eligibility schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).ScopeType = value ?? null; } /// Start DateTime when role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -192,7 +192,7 @@ public partial class RoleEligibilitySchedule : /// DateTime when role eligibility schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? UpdatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)Property).UpdatedOn = value ?? default(global::System.DateTime); } /// Creates an new instance. public RoleEligibilitySchedule() @@ -211,6 +211,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -219,6 +222,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -227,6 +233,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -235,6 +244,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role eligibility schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -243,6 +255,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +266,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +277,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +288,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -275,14 +299,21 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +322,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +333,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +344,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -315,16 +355,23 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleEligibilityScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -333,6 +380,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -341,6 +391,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -349,6 +402,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -357,6 +413,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -365,6 +424,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -373,6 +435,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -381,6 +446,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -389,6 +457,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role eligibility schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -397,14 +468,21 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -413,6 +491,9 @@ public partial interface IRoleEligibilitySchedule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -441,17 +522,18 @@ internal partial interface IRoleEligibilityScheduleInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role eligibility schedule Id. string Id { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule name. string Name { get; set; } /// Display name of the principal @@ -461,9 +543,10 @@ internal partial interface IRoleEligibilityScheduleInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// role eligibility schedule properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties Property { get; set; } /// /// The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule /// @@ -485,7 +568,8 @@ internal partial interface IRoleEligibilityScheduleInternal /// Start DateTime when role eligibility schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule type. string Type { get; set; } /// DateTime when role eligibility schedule was modified diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.json.cs index 49f05d366447..59d8c8f13c79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilitySchedule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilitySchedule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilitySchedule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilitySchedule(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilitySchedule(Microsoft.Azure.PowerShell.Cmdlets.Resources.Au { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.PowerShell.cs similarity index 69% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.PowerShell.cs index 64703d914b7f..5233e92d1dc6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleFilter(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,21 +113,21 @@ internal RoleEligibilityScheduleFilter(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,15 +142,15 @@ internal RoleEligibilityScheduleFilter(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,6 +159,18 @@ internal RoleEligibilityScheduleFilter(global::System.Management.Automation.PSOb /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.TypeConverter.cs index 40fe4a8288e6..858a6981cd5c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.cs index 1e17ed43c220..a21928c62d0c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule filter public partial class RoleEligibilityScheduleFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilterInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface IRoleEligibilityScheduleFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.json.cs index d0efb268a4b7..d7f1dd94ddd6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleFilter(json) : null; } @@ -77,9 +77,9 @@ internal RoleEligibilityScheduleFilter(Microsoft.Azure.PowerShell.Cmdlets.Resour { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.cs new file mode 100644 index 000000000000..bccc8d5df91e --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.PowerShell.cs @@ -0,0 +1,398 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Information about current or upcoming role eligibility schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] + public partial class RoleEligibilityScheduleInstance + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstance(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Information about current or upcoming role eligibility schedule instance + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceTypeConverter))] + public partial interface IRoleEligibilityScheduleInstance + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.TypeConverter.cs index 392136c8bba6..fd2a52d527f3 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.cs index d4eeed71f0d1..7924254175bd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Information about current or upcoming role eligibility schedule instance public partial class RoleEligibilityScheduleInstance : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal { /// @@ -19,37 +19,37 @@ public partial class RoleEligibilityScheduleInstance : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } /// The endDateTime of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).EndDateTime = value ?? default(global::System.DateTime); } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Backing field for property. private string _id; @@ -62,31 +62,31 @@ public partial class RoleEligibilityScheduleInstance : /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType)""); } + public string MemberType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).MemberType = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties()); set { {_property = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -99,30 +99,30 @@ public partial class RoleEligibilityScheduleInstance : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalEmail = value ?? null; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType)""); } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).PrincipalType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties _property; /// Role eligibility schedule instance properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -132,52 +132,52 @@ public partial class RoleEligibilityScheduleInstance : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Id of the master role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId = value ?? null; } + public string RoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).RoleEligibilityScheduleId = value ?? null; } /// The role eligibility schedule scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Scope = value ?? null; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).ScopeType = value ?? null; } /// The startDateTime of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? StartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).StartDateTime = value ?? default(global::System.DateTime); } /// The status of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status)""); } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)Property).Status = value ?? null; } /// Backing field for property. private string _type; @@ -204,6 +204,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -212,6 +215,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -220,6 +226,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -228,6 +237,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role eligibility schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -236,6 +248,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -244,6 +259,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -252,6 +270,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -260,6 +281,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -268,14 +292,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule instance name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -284,6 +315,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -292,6 +326,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -300,6 +337,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -308,14 +348,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -324,6 +371,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -332,6 +382,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -340,6 +393,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role eligibility schedule", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -348,6 +404,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -356,6 +415,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -364,6 +426,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -372,6 +437,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -380,6 +448,9 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role eligibility schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -388,14 +459,21 @@ public partial interface IRoleEligibilityScheduleInstance : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule instance", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule instance type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule instance type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -424,17 +502,18 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// The role eligibility schedule instance ID. string Id { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// The role eligibility schedule instance name. string Name { get; set; } /// Display name of the principal @@ -444,9 +523,10 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role eligibility schedule instance properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties Property { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -466,7 +546,8 @@ internal partial interface IRoleEligibilityScheduleInstanceInternal /// The startDateTime of the role eligibility schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule instance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// The role eligibility schedule instance type. string Type { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.json.cs index ac8066365408..30dadd00cfda 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstance.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstance.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstance partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstance(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleInstance(Microsoft.Azure.PowerShell.Cmdlets.Reso { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.PowerShell.cs index 9f0a9374c682..04664746811b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleInstanceFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleInstanceFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleInstanceFilter(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,25 +116,25 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Collections.IDicti // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleEligibilityScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, 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,19 +149,19 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Management.Automat // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("RoleEligibilityScheduleId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -162,6 +170,18 @@ internal RoleEligibilityScheduleInstanceFilter(global::System.Management.Automat /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule instance filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs index 44ab680e41ce..f08f8611b0f6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.cs index 9dad08a2c1e6..003ee4a62f98 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule instance filter public partial class RoleEligibilityScheduleInstanceFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilterInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances belonging to a specific role eligibility schedule.", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +92,9 @@ public partial interface IRoleEligibilityScheduleInstanceFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility schedule instances of the specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.json.cs index dd94adafb846..f3c80e300387 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleInstanceFilter(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)RoleEligibilityScheduleId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)_roleEligibilityScheduleId;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.PowerShell.cs index af271a785f26..33932ddca2a9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleInstanceListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleInstanceListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleInstanceListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Collections.ID // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)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. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Management.Aut // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstanceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleInstanceListResult(global::System.Management.Aut /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule instance list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstanceListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs index 46ae33ad7c46..5ca63266b69b 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.cs index cd8ef19df277..2f0c266f1548 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule instance list operation result. public partial class RoleEligibilityScheduleInstanceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleInstanceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] _value; + private System.Collections.Generic.List _value; /// Role eligibility schedule instance list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] 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. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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) })] @@ -51,10 +54,13 @@ public partial interface IRoleEligibilityScheduleInstanceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role eligibility schedule instance list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance) })] + System.Collections.Generic.List Value { get; set; } } /// Role eligibility schedule instance list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleEligibilityScheduleInstanceListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role eligibility schedule instance list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.json.cs index fde1e2fafc87..5356afefcba6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleInstanceListResult(Microsoft.Azure.PowerShell.Cm { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleInstance.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleInstance) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleInstance.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs new file mode 100644 index 000000000000..9be54306c6de --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.PowerShell.cs @@ -0,0 +1,369 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] + public partial class RoleEligibilityScheduleInstanceProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleInstanceProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleInstanceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleInstanceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId = (string) content.GetValueForProperty("RoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleInstancePropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleInstanceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs index 65a1bb367145..a1f68e55697f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.cs similarity index 71% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.cs index 041bfb504ad7..205b34db60fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule properties with scope. public partial class RoleEligibilityScheduleInstanceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal { /// Backing field for property. @@ -46,49 +46,49 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstancePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -98,15 +98,15 @@ public partial class RoleEligibilityScheduleInstanceProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -117,7 +117,7 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _roleEligibilityScheduleId; @@ -135,15 +135,15 @@ public partial class RoleEligibilityScheduleInstanceProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -153,11 +153,11 @@ public partial class RoleEligibilityScheduleInstanceProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule instance [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// /// Creates an new instance. @@ -178,6 +178,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -186,6 +189,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +200,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -202,6 +211,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The endDateTime of the role eligibility schedule instance", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -210,6 +222,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +233,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -226,6 +244,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -234,14 +255,21 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -250,6 +278,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -258,6 +289,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -266,14 +300,21 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +323,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -290,6 +334,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -298,6 +345,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the master role eligibility schedule", SerializedName = @"roleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +356,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -314,6 +367,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -322,6 +378,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -330,6 +389,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -338,6 +400,9 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The startDateTime of the role eligibility schedule instance", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -346,10 +411,14 @@ public partial interface IRoleEligibilityScheduleInstanceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule instance", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } /// Role eligibility schedule properties with scope. @@ -374,15 +443,16 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -390,7 +460,8 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -410,7 +481,8 @@ internal partial interface IRoleEligibilityScheduleInstancePropertiesInternal /// The startDateTime of the role eligibility schedule instance global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule instance - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.json.cs index daf6fec9f290..dc297ac6819f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleInstanceProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleInstanceProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleInstanceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleInstanceProperties(json) : null; } @@ -77,19 +77,19 @@ internal RoleEligibilityScheduleInstanceProperties(Microsoft.Azure.PowerShell.Cm { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)RoleEligibilityScheduleId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleEligibilityScheduleId = If( json?.PropertyT("roleEligibilityScheduleId"), out var __jsonRoleEligibilityScheduleId) ? (string)__jsonRoleEligibilityScheduleId : (string)_roleEligibilityScheduleId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.PowerShell.cs index 14792417bfc4..1184fa7a0f30 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleListResult(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,17 +115,17 @@ internal RoleEligibilityScheduleListResult(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)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. @@ -132,11 +140,11 @@ internal RoleEligibilityScheduleListResult(global::System.Management.Automation. // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,6 +153,18 @@ internal RoleEligibilityScheduleListResult(global::System.Management.Automation. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// role eligibility schedule list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.TypeConverter.cs index 70ee95d26c25..26d52aeee6e8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.cs index 324933066e7e..6ade6d65fbf0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// role eligibility schedule list operation result. public partial class RoleEligibilityScheduleListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] _value; + private System.Collections.Generic.List _value; /// role eligibility schedule list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] 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 RoleEligibilityScheduleListResult() @@ -41,6 +41,9 @@ public partial interface IRoleEligibilityScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 IRoleEligibilityScheduleListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"role eligibility schedule list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule) })] + System.Collections.Generic.List Value { get; set; } } /// role eligibility schedule list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleEligibilityScheduleListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// role eligibility schedule list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.json.cs index 758f38be1c60..db3380ba072c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleListResult(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilitySchedule.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilitySchedule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilitySchedule.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs new file mode 100644 index 000000000000..9a74cb923fb7 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.PowerShell.cs @@ -0,0 +1,376 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] + public partial class RoleEligibilityScheduleProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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 RoleEligibilityScheduleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RoleEligibilityScheduleRequestId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId = (string) content.GetValueForProperty("RoleEligibilityScheduleRequestId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleEligibilityScheduleRequestId, global::System.Convert.ToString); + } + if (content.Contains("MemberType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType = (string) content.GetValueForProperty("MemberType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).MemberType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("StartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UpdatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn = (global::System.DateTime?) content.GetValueForProperty("UpdatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).UpdatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal)this).ExpandedPropertiesPrincipalType, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilitySchedulePropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.TypeConverter.cs index ff73692bdfa2..f45a2d429114 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.cs similarity index 72% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.cs index 52fa810eff07..e7dbdbd0a7cf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule properties with scope. public partial class RoleEligibilityScheduleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal { /// Backing field for property. @@ -46,49 +46,49 @@ public partial class RoleEligibilityScheduleProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set => this._expandedProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set => this._expandedProperty = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? _memberType; + private string _memberType; /// Membership type of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get => this._memberType; set => this._memberType = value; } + public string MemberType { get => this._memberType; set => this._memberType = value; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedulePropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Backing field for property. private string _principalId; @@ -98,15 +98,15 @@ public partial class RoleEligibilityScheduleProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; set => this._principalType = value; } + public string PrincipalType { get => this._principalType; set => this._principalType = value; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } /// Backing field for property. private string _roleDefinitionId; @@ -117,7 +117,7 @@ public partial class RoleEligibilityScheduleProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Backing field for property. private string _roleEligibilityScheduleRequestId; @@ -137,15 +137,15 @@ public partial class RoleEligibilityScheduleProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -155,11 +155,11 @@ public partial class RoleEligibilityScheduleProperties : public global::System.DateTime? StartDateTime { get => this._startDateTime; set => this._startDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Backing field for property. private global::System.DateTime? _updatedOn; @@ -185,6 +185,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -193,6 +196,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -201,6 +207,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -209,6 +218,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime when role eligibility schedule", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -217,6 +229,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -225,6 +240,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -233,6 +251,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -241,14 +262,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Membership type of the role eligibility schedule", SerializedName = @"memberType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -257,6 +285,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -265,6 +296,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -273,14 +307,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -289,6 +330,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -297,6 +341,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +354,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule", SerializedName = @"roleEligibilityScheduleRequestId", PossibleTypes = new [] { typeof(string) })] @@ -315,6 +365,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -323,6 +376,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -331,6 +387,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +398,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -347,6 +409,9 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime when role eligibility schedule", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -355,14 +420,21 @@ public partial interface IRoleEligibilityScheduleProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The status of the role eligibility schedule.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role eligibility schedule was modified [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime when role eligibility schedule was modified", SerializedName = @"updatedOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -391,15 +463,16 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Membership type of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType? MemberType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Inherited", "Direct", "Group")] + string MemberType { get; set; } /// Display name of the principal string PrincipalDisplayName { get; set; } /// Email id of the principal @@ -407,7 +480,8 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition ID. @@ -429,7 +503,8 @@ internal partial interface IRoleEligibilitySchedulePropertiesInternal /// Start DateTime when role eligibility schedule global::System.DateTime? StartDateTime { get; set; } /// The status of the role eligibility schedule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// DateTime when role eligibility schedule was modified global::System.DateTime? UpdatedOn { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.json.cs index 7d8cb03e0138..d28189791aaf 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleProperties(json) : null; } @@ -77,20 +77,20 @@ internal RoleEligibilityScheduleProperties(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_roleEligibilityScheduleRequestId = If( json?.PropertyT("roleEligibilityScheduleRequestId"), out var __jsonRoleEligibilityScheduleRequestId) ? (string)__jsonRoleEligibilityScheduleRequestId : (string)RoleEligibilityScheduleRequestId;} - {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)MemberType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : UpdatedOn : UpdatedOn;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_roleEligibilityScheduleRequestId = If( json?.PropertyT("roleEligibilityScheduleRequestId"), out var __jsonRoleEligibilityScheduleRequestId) ? (string)__jsonRoleEligibilityScheduleRequestId : (string)_roleEligibilityScheduleRequestId;} + {_memberType = If( json?.PropertyT("memberType"), out var __jsonMemberType) ? (string)__jsonMemberType : (string)_memberType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_updatedOn = If( json?.PropertyT("updatedOn"), out var __jsonUpdatedOn) ? global::System.DateTime.TryParse((string)__jsonUpdatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonUpdatedOnValue) ? __jsonUpdatedOnValue : _updatedOn : _updatedOn;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs new file mode 100644 index 000000000000..3c055db6dc2d --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.PowerShell.cs @@ -0,0 +1,486 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role Eligibility schedule request + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] + public partial class RoleEligibilityScheduleRequest + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequest(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role Eligibility schedule request + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestTypeConverter))] + public partial interface IRoleEligibilityScheduleRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.TypeConverter.cs index c9a7dfe548a8..4cf95f8c5299 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs index 573a211419ca..692cf6ca3627 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.cs @@ -3,20 +3,20 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role Eligibility schedule request public partial class RoleEligibilityScheduleRequest : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal { /// The approvalId of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; } + public string ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; } /// /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] @@ -24,47 +24,47 @@ public partial class RoleEligibilityScheduleRequest : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } + public string Condition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Condition = value ?? null; } /// Version of the condition. Currently accepted value is '2.0' [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } + public string ConditionVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ConditionVersion = value ?? null; } /// DateTime when role eligibility schedule request was created [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; } + public global::System.DateTime? CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; } /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationDuration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpirationType = value ?? null; } /// Backing field for property. private string _id; @@ -77,58 +77,88 @@ public partial class RoleEligibilityScheduleRequest : /// Justification for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } + public string Justification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Justification = value ?? null; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ApprovalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ApprovalId = value ?? null; } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.CreatedOn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).CreatedOn = value ?? default(global::System.DateTime); } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesPrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedProperty = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyPrincipal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ExpandedPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties()); set { {_property = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId = value ?? null; } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScheduleInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfo = value ?? null /* model class */; } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoExpiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status = value ?? null; } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.TicketInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfo = value ?? null /* model class */; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -141,42 +171,42 @@ public partial class RoleEligibilityScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalEmail; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } + public string PrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalId = value ?? null; } /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; } + public string PrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).PrincipalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties _property; /// Role eligibility schedule request properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties()); set => this._property = value; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); } + public string RequestType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestType = value ?? null; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; } + public string RequestorId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RequestorId; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -186,69 +216,69 @@ public partial class RoleEligibilityScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).RoleDefinitionType; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScheduleInfoStartDateTime = value ?? default(global::System.DateTime); } /// The role eligibility schedule request scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).ScopeType; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).Status; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId = value ?? null; } + public string TargetRoleEligibilityScheduleId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleId = value ?? null; } /// The role eligibility schedule instance id being updated [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TargetRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId = value ?? null; } + public string TargetRoleEligibilityScheduleInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TargetRoleEligibilityScheduleInstanceId = value ?? null; } /// Ticket number for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketNumber = value ?? null; } /// Ticket system name for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)Property).TicketInfoTicketSystem = value ?? null; } /// Backing field for property. private string _type; @@ -272,6 +302,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role eligibility schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -283,6 +316,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +327,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +338,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role eligibility schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -306,31 +348,43 @@ public partial interface IRoleEligibilityScheduleRequest : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +393,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -347,14 +404,21 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role eligibility schedule request ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -363,6 +427,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role eligibility", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -371,6 +438,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -378,23 +448,32 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -403,24 +482,35 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -428,15 +518,21 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -444,15 +540,21 @@ public partial interface IRoleEligibilityScheduleRequest : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -461,6 +563,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -468,41 +573,57 @@ public partial interface IRoleEligibilityScheduleRequest : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role eligibility schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", SerializedName = @"targetRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -511,6 +632,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule instance id being updated", SerializedName = @"targetRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -519,6 +643,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -527,6 +654,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -535,6 +665,9 @@ public partial interface IRoleEligibilityScheduleRequest : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -563,19 +696,20 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// The role eligibility schedule request ID. string Id { get; set; } /// Justification for the role eligibility @@ -589,13 +723,15 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// Role eligibility schedule request properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties Property { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType? RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -605,9 +741,9 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role eligibility schedule request scope. @@ -619,7 +755,8 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role eligibility schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// @@ -627,7 +764,7 @@ internal partial interface IRoleEligibilityScheduleRequestInternal /// The role eligibility schedule instance id being updated string TargetRoleEligibilityScheduleInstanceId { get; set; } /// Ticket Info of the role eligibility - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role eligibility string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role eligibility diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.json.cs index 875d826093dd..214249210fcc 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequest.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequest.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequest(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleRequest(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.PowerShell.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.PowerShell.cs index 78c3928a27a9..de2bb803970c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestFilter partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestFilter(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestFilter(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,25 +115,25 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Collections.IDictio // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status, 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. @@ -140,19 +148,19 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Management.Automati // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("RoleDefinitionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RoleDefinitionId, global::System.Convert.ToString); } if (content.Contains("RequestorId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).RequestorId, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -161,6 +169,18 @@ internal RoleEligibilityScheduleRequestFilter(global::System.Management.Automati /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule request filter [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestFilterTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.TypeConverter.cs index d11bffe5453b..a9b1ee5afc52 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.cs index 0e233fd31674..490d46e7fd15 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request filter public partial class RoleEligibilityScheduleRequestFilter : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilterInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilterInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of the specific principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests created by specific principal.", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of the specific role definition.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IRoleEligibilityScheduleRequestFilter : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Returns role eligibility requests of specific status.", SerializedName = @"status", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.json.cs index 4815a5e9512a..0d4877dfc305 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestFilter.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestFilter.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestFilter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestFilter(json) : null; } @@ -77,10 +77,10 @@ internal RoleEligibilityScheduleRequestFilter(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.PowerShell.cs index a2d4da18f4cb..1dc403d1b755 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)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. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleRequestListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role eligibility schedule request list operation result. [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.TypeConverter.cs index 6e46e031ab62..7aff1a61333a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.cs index dae9403bd257..5f043abda849 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request list operation result. public partial class RoleEligibilityScheduleRequestListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleEligibilityScheduleRequestListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] _value; + private System.Collections.Generic.List _value; /// Role eligibility schedule request list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] 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. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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) })] @@ -51,10 +54,13 @@ public partial interface IRoleEligibilityScheduleRequestListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role eligibility schedule request list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest) })] + System.Collections.Generic.List Value { get; set; } } /// Role eligibility schedule request list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleEligibilityScheduleRequestListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role eligibility schedule request list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.json.cs index a9db06adb783..304d96a60697 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleEligibilityScheduleRequestListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..429d3f6de344 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.PowerShell.cs @@ -0,0 +1,457 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role eligibility schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] + public partial class RoleEligibilityScheduleRequestProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleEligibilityScheduleRequestProperties(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.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleEligibilityScheduleRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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 RoleEligibilityScheduleRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScheduleInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo) content.GetValueForProperty("ScheduleInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter.ConvertFrom); + } + if (content.Contains("TicketInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo) content.GetValueForProperty("TicketInfo",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfo, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties) content.GetValueForProperty("ExpandedProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType = (string) content.GetValueForProperty("PrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalType, global::System.Convert.ToString); + } + if (content.Contains("RequestType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType = (string) content.GetValueForProperty("RequestType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestType, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("ApprovalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId = (string) content.GetValueForProperty("ApprovalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ApprovalId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleId, global::System.Convert.ToString); + } + if (content.Contains("TargetRoleEligibilityScheduleInstanceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId = (string) content.GetValueForProperty("TargetRoleEligibilityScheduleInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TargetRoleEligibilityScheduleInstanceId, global::System.Convert.ToString); + } + if (content.Contains("Justification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification = (string) content.GetValueForProperty("Justification",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Justification, global::System.Convert.ToString); + } + if (content.Contains("Condition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition = (string) content.GetValueForProperty("Condition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).Condition, global::System.Convert.ToString); + } + if (content.Contains("ConditionVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion = (string) content.GetValueForProperty("ConditionVersion",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ConditionVersion, global::System.Convert.ToString); + } + if (content.Contains("CreatedOn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn = (global::System.DateTime?) content.GetValueForProperty("CreatedOn",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).CreatedOn, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequestorId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId = (string) content.GetValueForProperty("RequestorId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RequestorId, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope) content.GetValueForProperty("ExpandedPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition) content.GetValueForProperty("ExpandedPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("ExpandedPropertyPrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal) content.GetValueForProperty("ExpandedPropertyPrincipal",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertyPrincipal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedPropertiesPrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoExpiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("ScheduleInfoExpiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoExpiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + } + if (content.Contains("ScheduleInfoStartDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime = (global::System.DateTime?) content.GetValueForProperty("ScheduleInfoStartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScheduleInfoStartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationType, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber = (string) content.GetValueForProperty("TicketInfoTicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketNumber, global::System.Convert.ToString); + } + if (content.Contains("TicketInfoTicketSystem")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem = (string) content.GetValueForProperty("TicketInfoTicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).TicketInfoTicketSystem, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId = (string) content.GetValueForProperty("ExpandedPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("PrincipalDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName = (string) content.GetValueForProperty("PrincipalDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalDisplayName, global::System.Convert.ToString); + } + if (content.Contains("PrincipalEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail = (string) content.GetValueForProperty("PrincipalEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).PrincipalEmail, global::System.Convert.ToString); + } + if (content.Contains("ExpandedPropertiesPrincipalType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType = (string) content.GetValueForProperty("ExpandedPropertiesPrincipalType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpandedPropertiesPrincipalType, global::System.Convert.ToString); + } + if (content.Contains("ExpirationEndDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpirationDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal)this).ExpirationDuration, 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.Resources.Authorization.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(); + } + } + /// Role eligibility schedule request properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTypeConverter))] + public partial interface IRoleEligibilityScheduleRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.TypeConverter.cs index 861bad560533..5c98052b9771 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.cs similarity index 61% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.cs index 6f1e6fef6bb5..c251a7946b1d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role eligibility schedule request properties with scope. public partial class RoleEligibilityScheduleRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal { /// Backing field for property. @@ -46,34 +46,34 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + public string ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + public string ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } + public string ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties _expandedProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties _expandedProperty; /// Additional properties of principal, scope and role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationDuration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationEndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).ExpirationType = value ?? null; } /// Backing field for property. private string _justification; @@ -83,51 +83,81 @@ public partial class RoleEligibilityScheduleRequestProperties : public string Justification { get => this._justification; set => this._justification = value; } /// Internal Acessors for ApprovalId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ApprovalId { get => this._approvalId; set { {_approvalId = value;} } } /// Internal Acessors for CreatedOn - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.CreatedOn { get => this._createdOn; set { {_createdOn = value;} } } + + /// Internal Acessors for ExpandedPropertiesPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalId = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesPrincipalType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesPrincipalType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalType = value ?? null; } + + /// Internal Acessors for ExpandedPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for ExpandedProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties()); set { {_expandedProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedProperty { get => (this._expandedProperty = this._expandedProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties()); set { {_expandedProperty = value;} } } /// Internal Acessors for ExpandedPropertyPrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Principal = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyPrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Principal = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for ExpandedPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ExpandedPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).Scope = value ?? null /* model class */; } + + /// Internal Acessors for PrincipalDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + + /// Internal Acessors for PrincipalEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } /// Internal Acessors for PrincipalType - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.PrincipalType { get => this._principalType; set { {_principalType = value;} } } /// Internal Acessors for RequestorId - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RequestorId { get => this._requestorId; set { {_requestorId = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for ScheduleInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set { {_scheduleInfo = value;} } } /// Internal Acessors for ScheduleInfoExpiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScheduleInfoExpiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).Expiration = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for TicketInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesInternal.TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set { {_ticketInfo = value;} } } /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName = value ?? null; } + public string PrincipalDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalDisplayName; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail = value ?? null; } + public string PrincipalEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).PrincipalEmail; } /// Backing field for property. private string _principalId; @@ -137,20 +167,20 @@ public partial class RoleEligibilityScheduleRequestProperties : public string PrincipalId { get => this._principalId; set => this._principalId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? _principalType; + private string _principalType; /// The principal type of the assigned principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get => this._principalType; } + public string PrincipalType { get => this._principalType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType _requestType; + private string _requestType; /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => this._requestType; set => this._requestType = value; } + public string RequestType { get => this._requestType; set => this._requestType = value; } /// Backing field for property. private string _requestorId; @@ -161,7 +191,7 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -172,18 +202,18 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).RoleDefinitionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo _scheduleInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo _scheduleInfo; /// Schedule info of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get => (this._scheduleInfo = this._scheduleInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo()); set => this._scheduleInfo = value; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ScheduleInfoStartDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)ScheduleInfo).StartDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private string _scope; @@ -194,22 +224,22 @@ public partial class RoleEligibilityScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesInternal)ExpandedProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesInternal)ExpandedProperty).ScopeType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? _status; + private string _status; /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _targetRoleEligibilityScheduleId; @@ -230,19 +260,19 @@ public partial class RoleEligibilityScheduleRequestProperties : public string TargetRoleEligibilityScheduleInstanceId { get => this._targetRoleEligibilityScheduleInstanceId; set => this._targetRoleEligibilityScheduleInstanceId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo _ticketInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo _ticketInfo; /// Ticket Info of the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get => (this._ticketInfo = this._ticketInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo()); set => this._ticketInfo = value; } /// Ticket number for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } + public string TicketInfoTicketNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketNumber = value ?? null; } /// Ticket system name for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } + public string TicketInfoTicketSystem { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)TicketInfo).TicketSystem = value ?? null; } /// /// Creates an new instance. @@ -260,6 +290,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The approvalId of the role eligibility schedule request.", SerializedName = @"approvalId", PossibleTypes = new [] { typeof(string) })] @@ -271,6 +304,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", SerializedName = @"condition", PossibleTypes = new [] { typeof(string) })] @@ -279,6 +315,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Version of the condition. Currently accepted value is '2.0'", SerializedName = @"conditionVersion", PossibleTypes = new [] { typeof(string) })] @@ -287,6 +326,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime when role eligibility schedule request was created", SerializedName = @"createdOn", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -294,31 +336,43 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the principal", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalId { get; set; } + string ExpandedPropertiesPrincipalId { get; } /// Type of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the principal", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesPrincipalType { get; set; } + string ExpandedPropertiesPrincipalType { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ExpandedPropertiesRoleDefinitionId { get; set; } + string ExpandedPropertiesRoleDefinitionId { get; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -327,6 +381,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -335,14 +392,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role eligibility [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Justification for the role eligibility", SerializedName = @"justification", PossibleTypes = new [] { typeof(string) })] @@ -350,23 +414,32 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the principal", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string PrincipalDisplayName { get; set; } + string PrincipalDisplayName { get; } /// Email id of the principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email id of the principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string PrincipalEmail { get; set; } + string PrincipalEmail { get; } /// The principal ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -375,24 +448,35 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal type of the assigned principal ID.", SerializedName = @"principalType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the user who created this request", SerializedName = @"requestorId", PossibleTypes = new [] { typeof(string) })] @@ -400,15 +484,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition ID. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition ID.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -416,15 +506,21 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -433,6 +529,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role eligibility schedule request scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -440,41 +539,57 @@ public partial interface IRoleEligibilityScheduleRequestProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The status of the role eligibility schedule request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the role eligibility schedule request.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", SerializedName = @"targetRoleEligibilityScheduleId", PossibleTypes = new [] { typeof(string) })] @@ -483,6 +598,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role eligibility schedule instance id being updated", SerializedName = @"targetRoleEligibilityScheduleInstanceId", PossibleTypes = new [] { typeof(string) })] @@ -491,6 +609,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -499,6 +620,9 @@ public partial interface IRoleEligibilityScheduleRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] @@ -527,19 +651,20 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Id of the role definition string ExpandedPropertiesRoleDefinitionId { get; set; } /// Additional properties of principal, scope and role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedProperties ExpandedProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedProperties ExpandedProperty { get; set; } /// Details of the principal - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesPrincipal ExpandedPropertyPrincipal { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesRoleDefinition ExpandedPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IExpandedPropertiesScope ExpandedPropertyScope { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Justification for the role eligibility string Justification { get; set; } /// Display name of the principal @@ -549,11 +674,13 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// The principal ID. string PrincipalId { get; set; } /// The principal type of the assigned principal ID. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType? PrincipalType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group", "ServicePrincipal", "Unknown", "DirectoryRoleTemplate", "ForeignGroup", "Application", "MSI", "DirectoryObjectOrGroup", "Everyone", "Device")] + string PrincipalType { get; set; } /// /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc /// - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + string RequestType { get; set; } /// Id of the user who created this request string RequestorId { get; set; } /// Display name of the role definition @@ -563,9 +690,9 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Type of the role definition string RoleDefinitionType { get; set; } /// Schedule info of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ScheduleInfo { get; set; } /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ScheduleInfoExpiration { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? ScheduleInfoStartDateTime { get; set; } /// The role eligibility schedule request scope. @@ -577,7 +704,8 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// Type of the resource string ScopeType { get; set; } /// The status of the role eligibility schedule request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Accepted", "PendingEvaluation", "Granted", "Denied", "PendingProvisioning", "Provisioned", "PendingRevocation", "Revoked", "Canceled", "Failed", "PendingApprovalProvisioning", "PendingApproval", "FailedAsResourceIsLocked", "PendingAdminDecision", "AdminApproved", "AdminDenied", "TimedOut", "ProvisioningStarted", "Invalid", "PendingScheduleCreation", "ScheduleCreated", "PendingExternalProvisioning")] + string Status { get; set; } /// /// The resultant role eligibility schedule id or the role eligibility schedule id being updated /// @@ -585,7 +713,7 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesInternal /// The role eligibility schedule instance id being updated string TargetRoleEligibilityScheduleInstanceId { get; set; } /// Ticket Info of the role eligibility - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo TicketInfo { get; set; } /// Ticket number for the role eligibility string TicketInfoTicketNumber { get; set; } /// Ticket system name for the role eligibility diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.json.cs similarity index 91% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.json.cs index 4efdf098d4e7..b6188e48d74e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestProperties(json) : null; } @@ -77,23 +77,23 @@ internal RoleEligibilityScheduleRequestProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : ScheduleInfo;} - {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : TicketInfo;} - {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ExpandedProperties.FromJson(__jsonExpandedProperties) : ExpandedProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)RequestType;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)ApprovalId;} - {_targetRoleEligibilityScheduleId = If( json?.PropertyT("targetRoleEligibilityScheduleId"), out var __jsonTargetRoleEligibilityScheduleId) ? (string)__jsonTargetRoleEligibilityScheduleId : (string)TargetRoleEligibilityScheduleId;} - {_targetRoleEligibilityScheduleInstanceId = If( json?.PropertyT("targetRoleEligibilityScheduleInstanceId"), out var __jsonTargetRoleEligibilityScheduleInstanceId) ? (string)__jsonTargetRoleEligibilityScheduleInstanceId : (string)TargetRoleEligibilityScheduleInstanceId;} - {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)Justification;} - {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)Condition;} - {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)ConditionVersion;} - {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : CreatedOn : CreatedOn;} - {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)RequestorId;} + {_scheduleInfo = If( json?.PropertyT("scheduleInfo"), out var __jsonScheduleInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfo.FromJson(__jsonScheduleInfo) : _scheduleInfo;} + {_ticketInfo = If( json?.PropertyT("ticketInfo"), out var __jsonTicketInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesTicketInfo.FromJson(__jsonTicketInfo) : _ticketInfo;} + {_expandedProperty = If( json?.PropertyT("expandedProperties"), out var __jsonExpandedProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ExpandedProperties.FromJson(__jsonExpandedProperties) : _expandedProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_requestType = If( json?.PropertyT("requestType"), out var __jsonRequestType) ? (string)__jsonRequestType : (string)_requestType;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_approvalId = If( json?.PropertyT("approvalId"), out var __jsonApprovalId) ? (string)__jsonApprovalId : (string)_approvalId;} + {_targetRoleEligibilityScheduleId = If( json?.PropertyT("targetRoleEligibilityScheduleId"), out var __jsonTargetRoleEligibilityScheduleId) ? (string)__jsonTargetRoleEligibilityScheduleId : (string)_targetRoleEligibilityScheduleId;} + {_targetRoleEligibilityScheduleInstanceId = If( json?.PropertyT("targetRoleEligibilityScheduleInstanceId"), out var __jsonTargetRoleEligibilityScheduleInstanceId) ? (string)__jsonTargetRoleEligibilityScheduleInstanceId : (string)_targetRoleEligibilityScheduleInstanceId;} + {_justification = If( json?.PropertyT("justification"), out var __jsonJustification) ? (string)__jsonJustification : (string)_justification;} + {_condition = If( json?.PropertyT("condition"), out var __jsonCondition) ? (string)__jsonCondition : (string)_condition;} + {_conditionVersion = If( json?.PropertyT("conditionVersion"), out var __jsonConditionVersion) ? (string)__jsonConditionVersion : (string)_conditionVersion;} + {_createdOn = If( json?.PropertyT("createdOn"), out var __jsonCreatedOn) ? global::System.DateTime.TryParse((string)__jsonCreatedOn, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedOnValue) ? __jsonCreatedOnValue : _createdOn : _createdOn;} + {_requestorId = If( json?.PropertyT("requestorId"), out var __jsonRequestorId) ? (string)__jsonRequestorId : (string)_requestorId;} AfterFromJson(json); } @@ -120,26 +120,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } AddIf( null != this._scheduleInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._scheduleInfo.ToJson(null,serializationMode) : null, "scheduleInfo" ,container.Add ); AddIf( null != this._ticketInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._ticketInfo.ToJson(null,serializationMode) : null, "ticketInfo" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expandedProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._expandedProperty.ToJson(null,serializationMode) : null, "expandedProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._roleDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._roleDefinitionId.ToString()) : null, "roleDefinitionId" ,container.Add ); AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._principalType.ToString()) : null, "principalType" ,container.Add ); } AddIf( null != (((object)this._requestType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestType.ToString()) : null, "requestType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._approvalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._approvalId.ToString()) : null, "approvalId" ,container.Add ); } @@ -148,11 +148,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J AddIf( null != (((object)this._justification)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._justification.ToString()) : null, "justification" ,container.Add ); AddIf( null != (((object)this._condition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._condition.ToString()) : null, "condition" ,container.Add ); AddIf( null != (((object)this._conditionVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._conditionVersion.ToString()) : null, "conditionVersion" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._createdOn ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._createdOn?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdOn" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._requestorId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._requestorId.ToString()) : null, "requestorId" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs similarity index 57% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs index 60c641242447..e632775e6d63 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfo(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,29 +116,29 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Col // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, 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. @@ -145,23 +153,23 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Man // actually deserialize if (content.Contains("Expiration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).Expiration, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter.ConvertFrom); } if (content.Contains("StartDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime = (global::System.DateTime?) content.GetValueForProperty("StartDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).StartDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType = (string) content.GetValueForProperty("ExpirationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationType, global::System.Convert.ToString); } if (content.Contains("ExpirationEndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpirationEndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationEndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("ExpirationDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration = (string) content.GetValueForProperty("ExpirationDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal)this).ExpirationDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -170,6 +178,18 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(global::System.Man /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Schedule info of the role eligibility schedule [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesScheduleInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs index 0b1e186b4284..b1d9e930714c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs similarity index 66% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs index 147ddf4c2257..269007df88b1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Schedule info of the role eligibility schedule public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration _expiration; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration _expiration; /// Expiration of the role eligibility schedule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set => this._expiration = value; } /// Duration of the role eligibility schedule in TimeSpan. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } + public string ExpirationDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Duration = value ?? null; } /// End DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpirationEndDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).EndDateTime = value ?? default(global::System.DateTime); } /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); } + public string ExpirationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)Expiration).Type = value ?? null; } /// Internal Acessors for Expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoInternal.Expiration { get => (this._expiration = this._expiration ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration()); set { {_expiration = value;} } } /// Backing field for property. private global::System.DateTime? _startDateTime; @@ -58,6 +58,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +69,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -74,14 +80,21 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role eligibility schedule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Start DateTime of the role eligibility schedule.", SerializedName = @"startDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -93,13 +106,14 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo { /// Expiration of the role eligibility schedule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration Expiration { get; set; } /// Duration of the role eligibility schedule in TimeSpan. string ExpirationDuration { get; set; } /// End DateTime of the role eligibility schedule. global::System.DateTime? ExpirationEndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? ExpirationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string ExpirationType { get; set; } /// Start DateTime of the role eligibility schedule. global::System.DateTime? StartDateTime { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs index 2b61fd770903..673a7dafa7e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesScheduleInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfo(Microsoft.Azure.Po { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : Expiration;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.FromJson(__jsonExpiration) : _expiration;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs similarity index 65% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs index b6bb1ceabfcf..de8e64c309d2 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,21 +116,21 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, 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. @@ -137,15 +145,15 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("EndDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime = (global::System.DateTime?) content.GetValueForProperty("EndDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).EndDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Duration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration = (string) content.GetValueForProperty("Duration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal)this).Duration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,6 +162,18 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(global:: /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Expiration of the role eligibility schedule [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs index 4c75fa70aca8..a01f0b56eb4a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there /// is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs similarity index 82% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs index 4b73b70718b7..7feaa01174b0 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Expiration of the role eligibility schedule public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpirationInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat public global::System.DateTime? EndDateTime { get => this._endDateTime; set => this._endDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? _type; + private string _type; /// Type of the role eligibility schedule expiration [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// /// Creates an new instance. @@ -50,6 +50,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Duration of the role eligibility schedule in TimeSpan.", SerializedName = @"duration", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"End DateTime of the role eligibility schedule.", SerializedName = @"endDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,10 +72,14 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfoEx [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } /// Expiration of the role eligibility schedule @@ -81,7 +91,8 @@ internal partial interface IRoleEligibilityScheduleRequestPropertiesScheduleInfo /// End DateTime of the role eligibility schedule. global::System.DateTime? EndDateTime { get; set; } /// Type of the role eligibility schedule expiration - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs index 38681f14ed47..49fa7def714a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpirat partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(json) : null; } @@ -78,9 +78,9 @@ internal RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration(Microsof { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)Duration;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_duration = If( json?.PropertyT("duration"), out var __jsonDuration) ? (string)__jsonDuration : (string)_duration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs similarity index 70% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs index 94f4d372631e..d5cc903353b9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleEligibilityScheduleRequestPropertiesTicketInfo(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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleEligibilityScheduleRequestPropertiesTicketInfo(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Colle // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, 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. @@ -133,11 +141,11 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Manag // actually deserialize if (content.Contains("TicketNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber = (string) content.GetValueForProperty("TicketNumber",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketNumber, global::System.Convert.ToString); } if (content.Contains("TicketSystem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem = (string) content.GetValueForProperty("TicketSystem",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal)this).TicketSystem, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(global::System.Manag /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Ticket Info of the role eligibility [System.ComponentModel.TypeConverter(typeof(RoleEligibilityScheduleRequestPropertiesTicketInfoTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs index ddef752c170c..ee9de9e022e4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs index 8fc538e8a93c..443ef682d838 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Ticket Info of the role eligibility public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfoInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket number for the role eligibility", SerializedName = @"ticketNumber", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IRoleEligibilityScheduleRequestPropertiesTicketInfo : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Ticket system name for the role eligibility", SerializedName = @"ticketSystem", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs similarity index 94% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs index 7879cff3cfd5..340b788fdbfe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleEligibilityScheduleRequestPropertiesTicketInfo.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleEligibilityScheduleRequestPropertiesTicketInfo.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleEligibilityScheduleRequestPropertiesTicketInfo partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestPropertiesTicketInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleEligibilityScheduleRequestPropertiesTicketInfo(json) : null; } @@ -78,8 +78,8 @@ internal RoleEligibilityScheduleRequestPropertiesTicketInfo(Microsoft.Azure.Powe { return; } - {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)TicketNumber;} - {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)TicketSystem;} + {_ticketNumber = If( json?.PropertyT("ticketNumber"), out var __jsonTicketNumber) ? (string)__jsonTicketNumber : (string)_ticketNumber;} + {_ticketSystem = If( json?.PropertyT("ticketSystem"), out var __jsonTicketSystem) ? (string)__jsonTicketSystem : (string)_ticketSystem;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs new file mode 100644 index 000000000000..0159f84258ef --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.PowerShell.cs @@ -0,0 +1,324 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] + public partial class RoleManagementPolicy + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType, 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 RoleManagementPolicy(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.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal)this).ScopeType, 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.Resources.Authorization.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(); + } + } + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyTypeConverter))] + public partial interface IRoleManagementPolicy + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.TypeConverter.cs index 19028eed5639..0553f3217f5a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs index e6257785738d..687bb2ccad79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.cs @@ -3,30 +3,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy public partial class RoleManagementPolicy : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal { /// The role management policy description. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Description = value ?? null; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Description = value ?? null; } /// The role management policy display name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).DisplayName = value ?? null; } /// The readonly computed rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; } + public System.Collections.Generic.List EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; } /// Backing field for property. private string _id; @@ -39,62 +39,83 @@ public partial class RoleManagementPolicy : /// The role management policy is default policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public bool? IsOrganizationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault = value ?? default(bool); } + public bool? IsOrganizationDefault { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).IsOrganizationDefault = value ?? default(bool); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; } + public global::System.DateTime? LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; } /// Internal Acessors for EffectiveRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.EffectiveRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).EffectiveRule = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.LastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedByType = value ?? null; } /// Internal Acessors for LastModifiedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.LastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).LastModifiedDateTime = value ?? default(global::System.DateTime); } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for PolicyProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.PolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.PolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyProperty = value ?? null /* model class */; } /// Internal Acessors for PolicyPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).PolicyPropertyScope = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties()); set { {_property = value;} } } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -105,12 +126,12 @@ public partial class RoleManagementPolicy : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties _property; /// Role management policy properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -120,27 +141,27 @@ public partial class RoleManagementPolicy : /// The rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Rule = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Rule = value ?? null /* arrayOf */; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)Property).ScopeType; } /// Backing field for property. private string _type; @@ -164,6 +185,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +196,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy display name.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -180,14 +207,20 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The readonly computed rule applied to the policy.", SerializedName = @"effectiveRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List EffectiveRule { get; } /// The role management policy Id. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -196,6 +229,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy is default policy.", SerializedName = @"isOrganizationDefault", PossibleTypes = new [] { typeof(bool) })] @@ -203,39 +239,54 @@ public partial interface IRoleManagementPolicy : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -244,6 +295,9 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -252,14 +306,20 @@ public partial interface IRoleManagementPolicy : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -267,31 +327,43 @@ public partial interface IRoleManagementPolicy : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The role management policy type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -307,13 +379,13 @@ internal partial interface IRoleManagementPolicyInternal /// The role management policy display name. string DisplayName { get; set; } /// The readonly computed rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; set; } + System.Collections.Generic.List EffectiveRule { get; set; } /// The role management policy Id. string Id { get; set; } /// The role management policy is default policy. bool? IsOrganizationDefault { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal @@ -327,13 +399,13 @@ internal partial interface IRoleManagementPolicyInternal /// The role management policy name. string Name { get; set; } /// Additional properties of scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope PolicyPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope PolicyPropertyScope { get; set; } /// Role management policy properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties Property { get; set; } /// The rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. string Scope { get; set; } /// Display name of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.json.cs index 8aaed98f5a85..88219680928f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicy.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicy.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicy(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicy(Microsoft.Azure.PowerShell.Cmdlets.Resources.Autho { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs new file mode 100644 index 000000000000..1a87ad9c116d --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.PowerShell.cs @@ -0,0 +1,278 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// The role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] + public partial class RoleManagementPolicyApprovalRule + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyApprovalRule(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.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyApprovalRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); + } + if (content.Contains("SettingApprovalMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (string) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, global::System.Convert.ToString); + } + if (content.Contains("SettingIsApprovalRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsApprovalRequiredForExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsRequestorJustificationRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingApprovalStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RoleManagementPolicyApprovalRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Setting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings) content.GetValueForProperty("Setting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).Setting, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); + } + if (content.Contains("SettingApprovalMode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode = (string) content.GetValueForProperty("SettingApprovalMode",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalMode, global::System.Convert.ToString); + } + if (content.Contains("SettingIsApprovalRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired = (bool?) content.GetValueForProperty("SettingIsApprovalRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsApprovalRequiredForExtension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension = (bool?) content.GetValueForProperty("SettingIsApprovalRequiredForExtension",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsApprovalRequiredForExtension, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingIsRequestorJustificationRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired = (bool?) content.GetValueForProperty("SettingIsRequestorJustificationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingIsRequestorJustificationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SettingApprovalStage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage = (System.Collections.Generic.List) content.GetValueForProperty("SettingApprovalStage",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal)this).SettingApprovalStage, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalStageTypeConverter.ConvertFrom)); + } + 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.Resources.Authorization.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 role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyApprovalRuleTypeConverter))] + public partial interface IRoleManagementPolicyApprovalRule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.TypeConverter.cs index e8f64c98f235..4dd66cc1edd6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs index a1b956b19c00..d06e20de432e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.cs @@ -3,92 +3,96 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyApprovalRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Internal Acessors for Setting - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRuleInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings()); set { {_setting = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRuleInternal.Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings()); set { {_setting = value;} } } + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyApprovalRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyApprovalRule"; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings _setting; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings _setting; /// The approval setting [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings()); set => this._setting = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Setting { get => (this._setting = this._setting ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings()); set => this._setting = value; } /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode)""); } + public string SettingApprovalMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalMode = value ?? null; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).ApprovalStage = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SettingApprovalStage { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalStage; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).ApprovalStage = value ?? null /* arrayOf */; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequired = value ?? default(bool); } + public bool? SettingIsApprovalRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequired = value ?? default(bool); } /// Determine whether approval is required for assignment extension. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsApprovalRequiredForExtension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension = value ?? default(bool); } + public bool? SettingIsApprovalRequiredForExtension { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsApprovalRequiredForExtension = value ?? default(bool); } /// Determine whether requestor justification required. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public bool? SettingIsRequestorJustificationRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired = value ?? default(bool); } + public bool? SettingIsRequestorJustificationRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettingsInternal)Setting).IsRequestorJustificationRequired = value ?? default(bool); } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyApprovalRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyApprovalRule"; } /// Validates that this object meets the validation criteria. @@ -106,28 +110,38 @@ public RoleManagementPolicyApprovalRule() /// The role management policy rule. public partial interface IRoleManagementPolicyApprovalRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"approvalMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string SettingApprovalMode { get; set; } /// The approval stages of the request. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The approval stages of the request.", SerializedName = @"approvalStages", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalStage) })] + System.Collections.Generic.List SettingApprovalStage { get; set; } /// Determine whether approval is required or not. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required or not.", SerializedName = @"isApprovalRequired", PossibleTypes = new [] { typeof(bool) })] @@ -136,6 +150,9 @@ public partial interface IRoleManagementPolicyApprovalRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether approval is required for assignment extension.", SerializedName = @"isApprovalRequiredForExtension", PossibleTypes = new [] { typeof(bool) })] @@ -144,6 +161,9 @@ public partial interface IRoleManagementPolicyApprovalRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Determine whether requestor justification required.", SerializedName = @"isRequestorJustificationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -152,14 +172,15 @@ public partial interface IRoleManagementPolicyApprovalRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyApprovalRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The approval setting - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalSettings Setting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IApprovalSettings Setting { get; set; } /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode? SettingApprovalMode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("SingleStage", "Serial", "Parallel", "NoApproval")] + string SettingApprovalMode { get; set; } /// The approval stages of the request. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IApprovalStage[] SettingApprovalStage { get; set; } + System.Collections.Generic.List SettingApprovalStage { get; set; } /// Determine whether approval is required or not. bool? SettingIsApprovalRequired { get; set; } /// Determine whether approval is required for assignment extension. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.json.cs index 781c0b442c00..d709c2f6b3de 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyApprovalRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyApprovalRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyApprovalRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyApprovalRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyApprovalRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyApprovalRule(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyApprovalRule(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ApprovalSettings.FromJson(__jsonSetting) : Setting;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_setting = If( json?.PropertyT("setting"), out var __jsonSetting) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ApprovalSettings.FromJson(__jsonSetting) : _setting;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.PowerShell.cs new file mode 100644 index 000000000000..f2b929cc1b35 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] + public partial class RoleManagementPolicyAssignment + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignment(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal)this).LastModifiedByEmail, 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.Resources.Authorization.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(); + } + } + /// Role management policy + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentTypeConverter))] + public partial interface IRoleManagementPolicyAssignment + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.TypeConverter.cs index 4941755e8b96..92e00726e171 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.cs index d788b7acccd5..0d0aa6125728 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy public partial class RoleManagementPolicyAssignment : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal { /// Backing field for property. @@ -24,52 +24,88 @@ public partial class RoleManagementPolicyAssignment : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).LastModifiedByType = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for PolicyAssignmentPropertiesPolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId = value ?? null; } /// Internal Acessors for PolicyAssignmentProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentProperty = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyPolicy = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyRoleDefinition = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertyScope = value ?? null /* model class */; } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for PolicyLastModifiedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties()); set { {_property = value;} } } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType = value ?? null; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope = value ?? null; } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -82,30 +118,30 @@ public partial class RoleManagementPolicyAssignment : /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId = value ?? null; } + public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesPolicyId; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId = value ?? null; } + public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyAssignmentPropertiesRoleDefinitionId; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 5)] - public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId = value ?? null; } + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyId = value ?? null; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).PolicyLastModifiedDateTime; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties _property; /// Role management policy properties. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] @@ -115,37 +151,37 @@ public partial class RoleManagementPolicyAssignment : /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionDisplayName; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 4)] - public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId = value ?? null; } + public string RoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionId = value ?? null; } /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).RoleDefinitionType; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.FormatTable(Index = 3)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).Scope; } /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.DoNotFormat] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)Property).ScopeType; } /// Backing field for property. private string _type; @@ -169,6 +205,9 @@ public partial interface IRoleManagementPolicyAssignment : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy Id.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -176,39 +215,54 @@ public partial interface IRoleManagementPolicyAssignment : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The role management policy name. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -216,23 +270,32 @@ public partial interface IRoleManagementPolicyAssignment : /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesPolicyId { get; set; } + string PolicyAssignmentPropertiesPolicyId { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } + string PolicyAssignmentPropertiesRoleDefinitionId { get; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The policy id role management policy assignment.", SerializedName = @"policyId", PossibleTypes = new [] { typeof(string) })] @@ -240,23 +303,32 @@ public partial interface IRoleManagementPolicyAssignment : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? PolicyLastModifiedDateTime { get; set; } + global::System.DateTime? PolicyLastModifiedDateTime { get; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition of management policy assignment.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -264,15 +336,21 @@ public partial interface IRoleManagementPolicyAssignment : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -280,31 +358,43 @@ public partial interface IRoleManagementPolicyAssignment : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } /// The role management policy type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -332,21 +422,21 @@ internal partial interface IRoleManagementPolicyAssignmentInternal /// Id of the role definition string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } /// Additional properties of scope, role definition and policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } /// The policy id role management policy assignment. string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Role management policy properties. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties Property { get; set; } /// Display name of the role definition string RoleDefinitionDisplayName { get; set; } /// The role definition of management policy assignment. diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.json.cs index 2af1b4688dc8..5ca03ac4fd6e 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignment.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignment.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignment partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignment(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicyAssignment(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentProperties.FromJson(__jsonProperties) : _property;} + {_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); } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.PowerShell.cs similarity index 67% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.PowerShell.cs index dc75049fc2bf..dc589af3886c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyAssignmentListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyAssignmentListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyAssignmentListResult(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,17 +116,17 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Collections.IDi // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)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. @@ -133,11 +141,11 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Management.Auto // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -146,6 +154,18 @@ internal RoleManagementPolicyAssignmentListResult(global::System.Management.Auto /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role management policy assignment list operation result. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.TypeConverter.cs index ff444091d313..54bb45545669 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.cs index 7fd2a1d52e90..765ba259dd39 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy assignment list operation result. public partial class RoleManagementPolicyAssignmentListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleManagementPolicyAssignmentListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] _value; + private System.Collections.Generic.List _value; /// Role management policy assignment list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] 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. @@ -43,6 +43,9 @@ public partial interface IRoleManagementPolicyAssignmentListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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) })] @@ -51,10 +54,13 @@ public partial interface IRoleManagementPolicyAssignmentListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role management policy assignment list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment) })] + System.Collections.Generic.List Value { get; set; } } /// Role management policy assignment list operation result. @@ -64,7 +70,7 @@ internal partial interface IRoleManagementPolicyAssignmentListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role management policy assignment list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.json.cs index 5590c5035e09..5cb6d775cfd8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignmentListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignmentListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyAssignmentListResult(Microsoft.Azure.PowerShell.Cmd { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs new file mode 100644 index 000000000000..7a1f8cd13f50 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.PowerShell.cs @@ -0,0 +1,321 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy assignment properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] + public partial class RoleManagementPolicyAssignmentProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyAssignmentProperties(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.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyAssignmentProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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 RoleManagementPolicyAssignmentProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyAssignmentProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties) content.GetValueForProperty("PolicyAssignmentProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId = (string) content.GetValueForProperty("RoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope) content.GetValueForProperty("PolicyAssignmentPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyRoleDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition) content.GetValueForProperty("PolicyAssignmentPropertyRoleDefinition",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyRoleDefinition, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesRoleDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyAssignmentPropertyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy) content.GetValueForProperty("PolicyAssignmentPropertyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentPropertiesPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).ScopeType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesRoleDefinitionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesRoleDefinitionId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesRoleDefinitionId, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName = (string) content.GetValueForProperty("RoleDefinitionDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionDisplayName, global::System.Convert.ToString); + } + if (content.Contains("RoleDefinitionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType = (string) content.GetValueForProperty("RoleDefinitionType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).RoleDefinitionType, global::System.Convert.ToString); + } + if (content.Contains("PolicyAssignmentPropertiesPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId = (string) content.GetValueForProperty("PolicyAssignmentPropertiesPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyAssignmentPropertiesPolicyId, global::System.Convert.ToString); + } + if (content.Contains("PolicyLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("PolicyLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyLastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("PolicyLastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).PolicyLastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal)this).LastModifiedByEmail, 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.Resources.Authorization.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(); + } + } + /// Role management policy assignment properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAssignmentPropertiesTypeConverter))] + public partial interface IRoleManagementPolicyAssignmentProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.TypeConverter.cs index 8a372e04e484..33b5a828d3c9 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs similarity index 53% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs index 2c698600e259..c6f7294adf7a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.cs @@ -3,64 +3,100 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy assignment properties with scope. public partial class RoleManagementPolicyAssignmentProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal { /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByDisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByEmail = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedById = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).LastModifiedByType = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesPolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId = value ?? null; } + + /// Internal Acessors for PolicyAssignmentPropertiesRoleDefinitionId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId = value ?? null; } /// Internal Acessors for PolicyAssignmentProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties()); set { {_policyAssignmentProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties()); set { {_policyAssignmentProperty = value;} } } /// Internal Acessors for PolicyAssignmentPropertyPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Policy = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyRoleDefinition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyRoleDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinition = value ?? null /* model class */; } /// Internal Acessors for PolicyAssignmentPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyAssignmentPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).Scope = value ?? null /* model class */; } /// Internal Acessors for PolicyLastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedBy = value ?? null /* model class */; } + + /// Internal Acessors for PolicyLastModifiedDateTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RoleDefinitionDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName = value ?? null; } + + /// Internal Acessors for RoleDefinitionType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType = value ?? null; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType = value ?? null; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId = value ?? null; } + public string PolicyAssignmentPropertiesPolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyId; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId = value ?? null; } + public string PolicyAssignmentPropertiesRoleDefinitionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties _policyAssignmentProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties _policyAssignmentProperty; /// Additional properties of scope, role definition and policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get => (this._policyAssignmentProperty = this._policyAssignmentProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties()); } /// Backing field for property. private string _policyId; @@ -71,11 +107,11 @@ public partial class RoleManagementPolicyAssignmentProperties : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PolicyLastModifiedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).PolicyLastModifiedDateTime; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName = value ?? null; } + public string RoleDefinitionDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionDisplayName; } /// Backing field for property. private string _roleDefinitionId; @@ -86,7 +122,7 @@ public partial class RoleManagementPolicyAssignmentProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType = value ?? null; } + public string RoleDefinitionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).RoleDefinitionType; } /// Backing field for property. private string _scope; @@ -97,15 +133,15 @@ public partial class RoleManagementPolicyAssignmentProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesInternal)PolicyAssignmentProperty).ScopeType; } /// /// Creates an new instance. @@ -122,55 +158,76 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// Id of the policy [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the policy", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesPolicyId { get; set; } + string PolicyAssignmentPropertiesPolicyId { get; } /// Id of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Id of the role definition", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } + string PolicyAssignmentPropertiesRoleDefinitionId { get; } /// The policy id role management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The policy id role management policy assignment.", SerializedName = @"policyId", PossibleTypes = new [] { typeof(string) })] @@ -178,23 +235,32 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? PolicyLastModifiedDateTime { get; set; } + global::System.DateTime? PolicyLastModifiedDateTime { get; } /// Display name of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the role definition", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionDisplayName { get; set; } + string RoleDefinitionDisplayName { get; } /// The role definition of management policy assignment. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role definition of management policy assignment.", SerializedName = @"roleDefinitionId", PossibleTypes = new [] { typeof(string) })] @@ -202,15 +268,21 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// Type of the role definition [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the role definition", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string RoleDefinitionType { get; set; } + string RoleDefinitionType { get; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -218,27 +290,36 @@ public partial interface IRoleManagementPolicyAssignmentProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } /// Role management policy assignment properties with scope. @@ -258,17 +339,17 @@ internal partial interface IRoleManagementPolicyAssignmentPropertiesInternal /// Id of the role definition string PolicyAssignmentPropertiesRoleDefinitionId { get; set; } /// Additional properties of scope, role definition and policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentProperties PolicyAssignmentProperty { get; set; } /// Details of the policy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesPolicy PolicyAssignmentPropertyPolicy { get; set; } /// Details of role definition - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesRoleDefinition PolicyAssignmentPropertyRoleDefinition { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyAssignmentPropertiesScope PolicyAssignmentPropertyScope { get; set; } /// The policy id role management policy assignment. string PolicyId { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal PolicyLastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal PolicyLastModifiedBy { get; set; } /// The last modified date time. global::System.DateTime? PolicyLastModifiedDateTime { get; set; } /// Display name of the role definition diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.json.cs index 591c50845cb7..8905599f3ceb 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAssignmentProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAssignmentProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAssignmentProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAssignmentProperties(json) : null; } @@ -77,10 +77,10 @@ internal RoleManagementPolicyAssignmentProperties(Microsoft.Azure.PowerShell.Cmd { return; } - {_policyAssignmentProperty = If( json?.PropertyT("policyAssignmentProperties"), out var __jsonPolicyAssignmentProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyAssignmentProperties.FromJson(__jsonPolicyAssignmentProperties) : PolicyAssignmentProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)RoleDefinitionId;} - {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_policyAssignmentProperty = If( json?.PropertyT("policyAssignmentProperties"), out var __jsonPolicyAssignmentProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyAssignmentProperties.FromJson(__jsonPolicyAssignmentProperties) : _policyAssignmentProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_roleDefinitionId = If( json?.PropertyT("roleDefinitionId"), out var __jsonRoleDefinitionId) ? (string)__jsonRoleDefinitionId : (string)_roleDefinitionId;} + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)_policyId;} AfterFromJson(json); } @@ -105,11 +105,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._policyAssignmentProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._policyAssignmentProperty.ToJson(null,serializationMode) : null, "policyAssignmentProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs index 256352c06c7c..daaefbc1fb48 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyAuthenticationContextRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyAuthenticationContextRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyAuthenticationContextRule(content); } @@ -90,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -108,53 +116,53 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Collection // actually deserialize if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ClaimValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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. @@ -169,47 +177,47 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Management // actually deserialize if (content.Contains("IsEnabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled = (bool?) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).IsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ClaimValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue = (string) content.GetValueForProperty("ClaimValue",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal)this).ClaimValue, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -218,6 +226,18 @@ internal RoleManagementPolicyAuthenticationContextRule(global::System.Management /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyAuthenticationContextRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs index 4f3d907ec11b..b006a2d9949c 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs index 195d0d52a176..335f1cf32c4a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyAuthenticationContextRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// Backing field for property. private string _claimValue; @@ -28,7 +28,7 @@ public partial class RoleManagementPolicyAuthenticationContextRule : /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isEnabled; @@ -37,44 +37,48 @@ public partial class RoleManagementPolicyAuthenticationContextRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public bool? IsEnabled { get => this._isEnabled; set => this._isEnabled = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyAuthenticationContextRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyAuthenticationContextRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// /// Creates an new instance. /// public RoleManagementPolicyAuthenticationContextRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyAuthenticationContextRule"; } /// Validates that this object meets the validation criteria. @@ -92,12 +96,15 @@ public RoleManagementPolicyAuthenticationContextRule() /// The role management policy rule. public partial interface IRoleManagementPolicyAuthenticationContextRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The claim value. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The claim value.", SerializedName = @"claimValue", PossibleTypes = new [] { typeof(string) })] @@ -106,6 +113,9 @@ public partial interface IRoleManagementPolicyAuthenticationContextRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating if rule is enabled.", SerializedName = @"isEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -114,7 +124,7 @@ public partial interface IRoleManagementPolicyAuthenticationContextRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyAuthenticationContextRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The claim value. string ClaimValue { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.json.cs index 9a8aa608415d..224fe16796b4 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyAuthenticationContextRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyAuthenticationContextRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyAuthenticationContextRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAuthenticationContextRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAuthenticationContextRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyAuthenticationContextRule(json) : null; } @@ -78,9 +78,9 @@ internal RoleManagementPolicyAuthenticationContextRule(Microsoft.Azure.PowerShel { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_claimValue = If( json?.PropertyT("claimValue"), out var __jsonClaimValue) ? (string)__jsonClaimValue : (string)ClaimValue;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_claimValue = If( json?.PropertyT("claimValue"), out var __jsonClaimValue) ? (string)__jsonClaimValue : (string)_claimValue;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.PowerShell.cs similarity index 52% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.PowerShell.cs index 59bf19567cfa..298f5fb0da19 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyEnablementRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyEnablementRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyEnablementRule(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,49 +115,49 @@ internal RoleManagementPolicyEnablementRule(global::System.Collections.IDictiona // actually deserialize if (content.Contains("EnabledRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[]) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (System.Collections.Generic.List) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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,43 +172,43 @@ internal RoleManagementPolicyEnablementRule(global::System.Management.Automation // actually deserialize if (content.Contains("EnabledRule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[]) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule = (System.Collections.Generic.List) content.GetValueForProperty("EnabledRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal)this).EnabledRule, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -209,6 +217,18 @@ internal RoleManagementPolicyEnablementRule(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyEnablementRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.TypeConverter.cs index dc8ff88dab99..583e34d8d7e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs index dfdaafaff34e..3f7820a3a2ff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.cs @@ -3,69 +3,73 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyEnablementRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] _enabledRule; + private System.Collections.Generic.List _enabledRule; /// The list of enabled rules. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get => this._enabledRule; set => this._enabledRule = value; } + public System.Collections.Generic.List EnabledRule { get => this._enabledRule; set => this._enabledRule = value; } /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyEnablementRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyEnablementRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyEnablementRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyEnablementRule"; } /// Validates that this object meets the validation criteria. @@ -83,24 +87,29 @@ public RoleManagementPolicyEnablementRule() /// The role management policy rule. public partial interface IRoleManagementPolicyEnablementRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The list of enabled rules. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enabled rules.", SerializedName = @"enabledRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("MultiFactorAuthentication", "Justification", "Ticketing")] + System.Collections.Generic.List EnabledRule { get; set; } } /// The role management policy rule. internal partial interface IRoleManagementPolicyEnablementRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The list of enabled rules. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules[] EnabledRule { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("MultiFactorAuthentication", "Justification", "Ticketing")] + System.Collections.Generic.List EnabledRule { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.json.cs similarity index 88% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.json.cs index 37eba3260404..a2bc812ae63d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyEnablementRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyEnablementRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyEnablementRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyEnablementRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyEnablementRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyEnablementRule(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyEnablementRule(Microsoft.Azure.PowerShell.Cmdlets.R { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_enabledRule = If( json?.PropertyT("enabledRules"), out var __jsonEnabledRules) ? If( __jsonEnabledRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Support.EnablementRules) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules)""))) ))() : null : EnabledRule;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_enabledRule = If( json?.PropertyT("enabledRules"), out var __jsonEnabledRules) ? If( __jsonEnabledRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _enabledRule;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.PowerShell.cs similarity index 51% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.PowerShell.cs index 8bdcecda392f..d3e45f981a0a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyExpirationRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyExpirationRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyExpirationRule(content); } @@ -89,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -107,53 +115,53 @@ internal RoleManagementPolicyExpirationRule(global::System.Collections.IDictiona // actually deserialize if (content.Contains("IsExpirationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("MaximumDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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. @@ -168,47 +176,47 @@ internal RoleManagementPolicyExpirationRule(global::System.Management.Automation // actually deserialize if (content.Contains("IsExpirationRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired = (bool?) content.GetValueForProperty("IsExpirationRequired",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).IsExpirationRequired, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("MaximumDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration = (string) content.GetValueForProperty("MaximumDuration",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal)this).MaximumDuration, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -217,6 +225,18 @@ internal RoleManagementPolicyExpirationRule(global::System.Management.Automation /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyExpirationRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.TypeConverter.cs index 002f3fc6b6a1..7a5acb0124d3 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs index 839761cd3b95..b6b12d98ae3a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyExpirationRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isExpirationRequired; @@ -37,42 +37,46 @@ public partial class RoleManagementPolicyExpirationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public string MaximumDuration { get => this._maximumDuration; set => this._maximumDuration = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyExpirationRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyExpirationRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyExpirationRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyExpirationRule"; } /// Validates that this object meets the validation criteria. @@ -90,12 +94,15 @@ public RoleManagementPolicyExpirationRule() /// The role management policy rule. public partial interface IRoleManagementPolicyExpirationRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// The value indicating whether expiration is required. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating whether expiration is required.", SerializedName = @"isExpirationRequired", PossibleTypes = new [] { typeof(bool) })] @@ -104,6 +111,9 @@ public partial interface IRoleManagementPolicyExpirationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum duration of expiration in timespan.", SerializedName = @"maximumDuration", PossibleTypes = new [] { typeof(string) })] @@ -112,7 +122,7 @@ public partial interface IRoleManagementPolicyExpirationRule : } /// The role management policy rule. internal partial interface IRoleManagementPolicyExpirationRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// The value indicating whether expiration is required. bool? IsExpirationRequired { get; set; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.json.cs similarity index 93% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.json.cs index 3c8394179f83..e56facf36907 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyExpirationRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyExpirationRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyExpirationRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyExpirationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyExpirationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyExpirationRule(json) : null; } @@ -77,9 +77,9 @@ internal RoleManagementPolicyExpirationRule(Microsoft.Azure.PowerShell.Cmdlets.R { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_isExpirationRequired = If( json?.PropertyT("isExpirationRequired"), out var __jsonIsExpirationRequired) ? (bool?)__jsonIsExpirationRequired : IsExpirationRequired;} - {_maximumDuration = If( json?.PropertyT("maximumDuration"), out var __jsonMaximumDuration) ? (string)__jsonMaximumDuration : (string)MaximumDuration;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_isExpirationRequired = If( json?.PropertyT("isExpirationRequired"), out var __jsonIsExpirationRequired) ? (bool?)__jsonIsExpirationRequired : _isExpirationRequired;} + {_maximumDuration = If( json?.PropertyT("maximumDuration"), out var __jsonMaximumDuration) ? (string)__jsonMaximumDuration : (string)_maximumDuration;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.PowerShell.cs index 50fcd818876b..d55bcb6fe721 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyListResult partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyListResult(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyListResult(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,17 +113,17 @@ internal RoleManagementPolicyListResult(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)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. @@ -130,11 +138,11 @@ internal RoleManagementPolicyListResult(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,6 +151,18 @@ internal RoleManagementPolicyListResult(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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(); + } } /// Role management policy list operation result. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyListResultTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.TypeConverter.cs index 841c7aaca3c2..7f73c71f2bf6 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.cs index c7ea3dcf2f0f..4d20aca7ed26 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy list operation result. public partial class RoleManagementPolicyListResult : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class RoleManagementPolicyListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] _value; + private System.Collections.Generic.List _value; /// Role management policy list. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] 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 RoleManagementPolicyListResult() @@ -41,6 +41,9 @@ public partial interface IRoleManagementPolicyListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 IRoleManagementPolicyListResult : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Role management policy list.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy) })] + System.Collections.Generic.List Value { get; set; } } /// Role management policy list operation result. @@ -62,7 +68,7 @@ internal partial interface IRoleManagementPolicyListResultInternal /// The URL to use for getting the next set of results. string NextLink { get; set; } /// Role management policy list. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.json.cs similarity index 89% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.json.cs index 3e80c59c86dd..523ad1c696f1 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyListResult.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyListResult.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyListResult(json) : null; } @@ -77,8 +77,8 @@ internal RoleManagementPolicyListResult(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy.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.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs new file mode 100644 index 000000000000..3cfc1618a0a7 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.PowerShell.cs @@ -0,0 +1,272 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// The role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] + public partial class RoleManagementPolicyNotificationRule + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyNotificationRule(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.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyNotificationRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NotificationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (string) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, global::System.Convert.ToString); + } + if (content.Contains("NotificationLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (string) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, global::System.Convert.ToString); + } + if (content.Contains("RecipientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (string) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, global::System.Convert.ToString); + } + if (content.Contains("NotificationRecipient")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (System.Collections.Generic.List) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsDefaultRecipientsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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 RoleManagementPolicyNotificationRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NotificationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType = (string) content.GetValueForProperty("NotificationType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationType, global::System.Convert.ToString); + } + if (content.Contains("NotificationLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel = (string) content.GetValueForProperty("NotificationLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationLevel, global::System.Convert.ToString); + } + if (content.Contains("RecipientType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType = (string) content.GetValueForProperty("RecipientType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).RecipientType, global::System.Convert.ToString); + } + if (content.Contains("NotificationRecipient")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient = (System.Collections.Generic.List) content.GetValueForProperty("NotificationRecipient",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).NotificationRecipient, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IsDefaultRecipientsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled = (bool?) content.GetValueForProperty("IsDefaultRecipientsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal)this).IsDefaultRecipientsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TargetCaller")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + } + if (content.Contains("TargetOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + } + if (content.Contains("TargetObject")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetInheritableSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("TargetEnforcedSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("RuleType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, 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.Resources.Authorization.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 role management policy rule. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyNotificationRuleTypeConverter))] + public partial interface IRoleManagementPolicyNotificationRule + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.TypeConverter.cs index 3ea66307ed01..0d29b53910c8 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs similarity index 56% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs index 1186d61f7254..9c3259d57191 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyNotificationRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRuleInternal, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRuleInternal, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(); /// The id of the rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Id = value ?? null; } /// Backing field for property. private bool? _isDefaultRecipientsEnabled; @@ -32,70 +32,74 @@ public partial class RoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] public bool? IsDefaultRecipientsEnabled { get => this._isDefaultRecipientsEnabled; set => this._isDefaultRecipientsEnabled = value; } + /// Internal Acessors for Target + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? _notificationLevel; + private string _notificationLevel; /// The notification level. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get => this._notificationLevel; set => this._notificationLevel = value; } + public string NotificationLevel { get => this._notificationLevel; set => this._notificationLevel = value; } /// Backing field for property. - private string[] _notificationRecipient; + private System.Collections.Generic.List _notificationRecipient; /// The list notification recipients. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] NotificationRecipient { get => this._notificationRecipient; set => this._notificationRecipient = value; } + public System.Collections.Generic.List NotificationRecipient { get => this._notificationRecipient; set => this._notificationRecipient = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? _notificationType; + private string _notificationType; /// The type of notification. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get => this._notificationType; set => this._notificationType = value; } + public string NotificationType { get => this._notificationType; set => this._notificationType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? _recipientType; + private string _recipientType; /// The recipient type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get => this._recipientType; set => this._recipientType = value; } + public string RecipientType { get => this._recipientType; set => this._recipientType = value; } /// The type of rule + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = value ; } + public string RuleType { get => "RoleManagementPolicyNotificationRule"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).RuleType = "RoleManagementPolicyNotificationRule"; } /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).Target = value ?? null /* model class */; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetCaller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetEnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetInheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetLevel = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inherited)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)__roleManagementPolicyRule).TargetOperation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyNotificationRule() { - + this.__roleManagementPolicyRule.RuleType = "RoleManagementPolicyNotificationRule"; } /// Validates that this object meets the validation criteria. @@ -113,7 +117,7 @@ public RoleManagementPolicyNotificationRule() /// The role management policy rule. public partial interface IRoleManagementPolicyNotificationRule : Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule { /// /// Its value determine if the notification need to be sent to the recipient type specified in policy rule. @@ -121,6 +125,9 @@ public partial interface IRoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Its value determine if the notification need to be sent to the recipient type specified in policy rule.", SerializedName = @"isDefaultRecipientsEnabled", PossibleTypes = new [] { typeof(bool) })] @@ -129,52 +136,70 @@ public partial interface IRoleManagementPolicyNotificationRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The notification level.", SerializedName = @"notificationLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("None", "Critical", "All")] + string NotificationLevel { get; set; } /// The list notification recipients. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list notification recipients.", SerializedName = @"notificationRecipients", PossibleTypes = new [] { typeof(string) })] - string[] NotificationRecipient { get; set; } + System.Collections.Generic.List NotificationRecipient { get; set; } /// The type of notification. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of notification.", SerializedName = @"notificationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Email")] + string NotificationType { get; set; } /// The recipient type. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The recipient type.", SerializedName = @"recipientType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Requestor", "Approver", "Admin")] + string RecipientType { get; set; } } /// The role management policy rule. internal partial interface IRoleManagementPolicyNotificationRuleInternal : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// /// Its value determine if the notification need to be sent to the recipient type specified in policy rule. /// bool? IsDefaultRecipientsEnabled { get; set; } /// The notification level. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel? NotificationLevel { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("None", "Critical", "All")] + string NotificationLevel { get; set; } /// The list notification recipients. - string[] NotificationRecipient { get; set; } + System.Collections.Generic.List NotificationRecipient { get; set; } /// The type of notification. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism? NotificationType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Email")] + string NotificationType { get; set; } /// The recipient type. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType? RecipientType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("Requestor", "Approver", "Admin")] + string RecipientType { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.json.cs similarity index 90% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.json.cs index dde409f2d659..95ab416f7515 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyNotificationRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyNotificationRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyNotificationRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyNotificationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyNotificationRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyNotificationRule(json) : null; } @@ -77,12 +77,12 @@ internal RoleManagementPolicyNotificationRule(Microsoft.Azure.PowerShell.Cmdlets { return; } - __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule(json); - {_notificationType = If( json?.PropertyT("notificationType"), out var __jsonNotificationType) ? (string)__jsonNotificationType : (string)NotificationType;} - {_notificationLevel = If( json?.PropertyT("notificationLevel"), out var __jsonNotificationLevel) ? (string)__jsonNotificationLevel : (string)NotificationLevel;} - {_recipientType = If( json?.PropertyT("recipientType"), out var __jsonRecipientType) ? (string)__jsonRecipientType : (string)RecipientType;} - {_notificationRecipient = If( json?.PropertyT("notificationRecipients"), out var __jsonNotificationRecipients) ? If( __jsonNotificationRecipients as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : NotificationRecipient;} - {_isDefaultRecipientsEnabled = If( json?.PropertyT("isDefaultRecipientsEnabled"), out var __jsonIsDefaultRecipientsEnabled) ? (bool?)__jsonIsDefaultRecipientsEnabled : IsDefaultRecipientsEnabled;} + __roleManagementPolicyRule = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule(json); + {_notificationType = If( json?.PropertyT("notificationType"), out var __jsonNotificationType) ? (string)__jsonNotificationType : (string)_notificationType;} + {_notificationLevel = If( json?.PropertyT("notificationLevel"), out var __jsonNotificationLevel) ? (string)__jsonNotificationLevel : (string)_notificationLevel;} + {_recipientType = If( json?.PropertyT("recipientType"), out var __jsonRecipientType) ? (string)__jsonRecipientType : (string)_recipientType;} + {_notificationRecipient = If( json?.PropertyT("notificationRecipients"), out var __jsonNotificationRecipients) ? If( __jsonNotificationRecipients as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _notificationRecipient;} + {_isDefaultRecipientsEnabled = If( json?.PropertyT("isDefaultRecipientsEnabled"), out var __jsonIsDefaultRecipientsEnabled) ? (bool?)__jsonIsDefaultRecipientsEnabled : _isDefaultRecipientsEnabled;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..456b64e3b0af --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.PowerShell.cs @@ -0,0 +1,294 @@ +// 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.Resources.Authorization.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + + /// Role management policy properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] + public partial class RoleManagementPolicyProperties + { + + /// + /// 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.Resources.Authorization.Models.IRoleManagementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.IRoleManagementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoleManagementPolicyProperties(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.Resources.Authorization.Models.IRoleManagementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoleManagementPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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 RoleManagementPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedBy, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PrincipalTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties) content.GetValueForProperty("PolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Scope, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("IsOrganizationDefault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault = (bool?) content.GetValueForProperty("IsOrganizationDefault",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).IsOrganizationDefault, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule = (System.Collections.Generic.List) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("EffectiveRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule = (System.Collections.Generic.List) content.GetValueForProperty("EffectiveRule",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).EffectiveRule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyPropertyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope) content.GetValueForProperty("PolicyPropertyScope",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).PolicyPropertyScope, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyPropertiesScopeTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedById")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById = (string) content.GetValueForProperty("LastModifiedById",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedById, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName = (string) content.GetValueForProperty("LastModifiedByDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByDisplayName, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail = (string) content.GetValueForProperty("LastModifiedByEmail",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).LastModifiedByEmail, global::System.Convert.ToString); + } + if (content.Contains("ScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeId, global::System.Convert.ToString); + } + if (content.Contains("ScopeDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName = (string) content.GetValueForProperty("ScopeDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType = (string) content.GetValueForProperty("ScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal)this).ScopeType, 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.Resources.Authorization.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(); + } + } + /// Role management policy properties with scope. + [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyPropertiesTypeConverter))] + public partial interface IRoleManagementPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.TypeConverter.cs index 9d6fb2cec7b3..b6c642ce8624 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.cs similarity index 61% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.cs index 92cacb61a6b2..c5118275b263 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// Role management policy properties with scope. public partial class RoleManagementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class RoleManagementPolicyProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] _effectiveRule; + private System.Collections.Generic.List _effectiveRule; /// The readonly computed rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get => this._effectiveRule; } + public System.Collections.Generic.List EffectiveRule { get => this._effectiveRule; } /// Backing field for property. private bool? _isOrganizationDefault; @@ -42,27 +42,27 @@ public partial class RoleManagementPolicyProperties : public bool? IsOrganizationDefault { get => this._isOrganizationDefault; set => this._isOrganizationDefault = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal _lastModifiedBy; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal _lastModifiedBy; /// The name of the entity last modified it [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); } /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + public string LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + public string LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + public string LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } + public string LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; } /// Backing field for property. private global::System.DateTime? _lastModifiedDateTime; @@ -72,36 +72,57 @@ public partial class RoleManagementPolicyProperties : public global::System.DateTime? LastModifiedDateTime { get => this._lastModifiedDateTime; } /// Internal Acessors for EffectiveRule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.EffectiveRule { get => this._effectiveRule; set { {_effectiveRule = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.EffectiveRule { get => this._effectiveRule; set { {_effectiveRule = value;} } } /// Internal Acessors for LastModifiedBy - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal()); set { {_lastModifiedBy = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedBy { get => (this._lastModifiedBy = this._lastModifiedBy ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal()); set { {_lastModifiedBy = value;} } } + + /// Internal Acessors for LastModifiedByDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).DisplayName = value ?? null; } + + /// Internal Acessors for LastModifiedByEmail + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Email = value ?? null; } + + /// Internal Acessors for LastModifiedById + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedById { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Id = value ?? null; } + + /// Internal Acessors for LastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipalInternal)LastModifiedBy).Type = value ?? null; } /// Internal Acessors for LastModifiedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.LastModifiedDateTime { get => this._lastModifiedDateTime; set { {_lastModifiedDateTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.LastModifiedDateTime { get => this._lastModifiedDateTime; set { {_lastModifiedDateTime = value;} } } /// Internal Acessors for PolicyProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties()); set { {_policyProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties()); set { {_policyProperty = value;} } } /// Internal Acessors for PolicyPropertyScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).Scope = value; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.PolicyPropertyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).Scope = value ?? null /* model class */; } /// Internal Acessors for Scope - string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.Scope { get => this._scope; set { {_scope = value;} } } + + /// Internal Acessors for ScopeDisplayName + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName = value ?? null; } + + /// Internal Acessors for ScopeId + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId = value ?? null; } + + /// Internal Acessors for ScopeType + string Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyPropertiesInternal.ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties _policyProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties _policyProperty; /// Additional properties of scope [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get => (this._policyProperty = this._policyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties()); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] _rule; + private System.Collections.Generic.List _rule; /// The rule applied to the policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => this._rule; set => this._rule = value; } + public System.Collections.Generic.List Rule { get => this._rule; set => this._rule = value; } /// Backing field for property. private string _scope; @@ -112,15 +133,15 @@ public partial class RoleManagementPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName = value ?? null; } + public string ScopeDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeDisplayName; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeId = value ?? null; } + public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeId; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesInternal)PolicyProperty).ScopeType = value ?? null; } + public string ScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesInternal)PolicyProperty).ScopeType; } /// Creates an new instance. public RoleManagementPolicyProperties() @@ -136,6 +157,9 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +168,9 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy display name.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -152,14 +179,20 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The readonly computed rule applied to the policy.", SerializedName = @"effectiveRules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List EffectiveRule { get; } /// The role management policy is default policy. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The role management policy is default policy.", SerializedName = @"isOrganizationDefault", PossibleTypes = new [] { typeof(bool) })] @@ -167,39 +200,54 @@ public partial interface IRoleManagementPolicyProperties : /// The name of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the principal made changes", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByDisplayName { get; set; } + string LastModifiedByDisplayName { get; } /// Email of principal [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Email of principal", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByEmail { get; set; } + string LastModifiedByEmail { get; } /// The id of the principal made changes [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The id of the principal made changes", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string LastModifiedById { get; set; } + string LastModifiedById { get; } /// Type of principal such as user , group etc [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of principal such as user , group etc", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string LastModifiedByType { get; set; } + string LastModifiedByType { get; } /// The last modified date time. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last modified date time.", SerializedName = @"lastModifiedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -208,14 +256,20 @@ public partial interface IRoleManagementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The role management policy scope.", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -223,27 +277,36 @@ public partial interface IRoleManagementPolicyProperties : /// Display name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the resource", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] - string ScopeDisplayName { get; set; } + string ScopeDisplayName { get; } /// Scope id of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Scope id of the resource", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } + string ScopeId { get; } /// Type of the resource [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of the resource", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] - string ScopeType { get; set; } + string ScopeType { get; } } /// Role management policy properties with scope. @@ -255,11 +318,11 @@ internal partial interface IRoleManagementPolicyPropertiesInternal /// The role management policy display name. string DisplayName { get; set; } /// The readonly computed rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] EffectiveRule { get; set; } + System.Collections.Generic.List EffectiveRule { get; set; } /// The role management policy is default policy. bool? IsOrganizationDefault { get; set; } /// The name of the entity last modified it - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPrincipal LastModifiedBy { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPrincipal LastModifiedBy { get; set; } /// The name of the principal made changes string LastModifiedByDisplayName { get; set; } /// Email of principal @@ -271,11 +334,11 @@ internal partial interface IRoleManagementPolicyPropertiesInternal /// The last modified date time. global::System.DateTime? LastModifiedDateTime { get; set; } /// Additional properties of scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyProperties PolicyProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyProperties PolicyProperty { get; set; } /// Details of the resource scope - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IPolicyPropertiesScope PolicyPropertyScope { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IPolicyPropertiesScope PolicyPropertyScope { get; set; } /// The rule applied to the policy. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get; set; } + System.Collections.Generic.List Rule { get; set; } /// The role management policy scope. string Scope { get; set; } /// Display name of the resource diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.json.cs similarity index 86% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.json.cs index 3c938cd20575..8625b630e774 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyProperties.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyProperties.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyProperties(json) : null; } @@ -77,15 +77,15 @@ internal RoleManagementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.Principal.FromJson(__jsonLastModifiedBy) : LastModifiedBy;} - {_policyProperty = If( json?.PropertyT("policyProperties"), out var __jsonPolicyProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.PolicyProperties.FromJson(__jsonPolicyProperties) : PolicyProperty;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : IsOrganizationDefault;} - {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : LastModifiedDateTime : LastModifiedDateTime;} - {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule.FromJson(__u) )) ))() : null : Rule;} - {_effectiveRule = If( json?.PropertyT("effectiveRules"), out var __jsonEffectiveRules) ? If( __jsonEffectiveRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRule.FromJson(__p) )) ))() : null : EffectiveRule;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Principal.FromJson(__jsonLastModifiedBy) : _lastModifiedBy;} + {_policyProperty = If( json?.PropertyT("policyProperties"), out var __jsonPolicyProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.PolicyProperties.FromJson(__jsonPolicyProperties) : _policyProperty;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : _isOrganizationDefault;} + {_lastModifiedDateTime = If( json?.PropertyT("lastModifiedDateTime"), out var __jsonLastModifiedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedDateTimeValue) ? __jsonLastModifiedDateTimeValue : _lastModifiedDateTime : _lastModifiedDateTime;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule.FromJson(__u) )) ))() : null : _rule;} + {_effectiveRule = If( json?.PropertyT("effectiveRules"), out var __jsonEffectiveRules) ? If( __jsonEffectiveRules as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRule.FromJson(__p) )) ))() : null : _effectiveRule;} AfterFromJson(json); } @@ -108,22 +108,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedBy ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._lastModifiedBy.ToJson(null,serializationMode) : null, "lastModifiedBy" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._policyProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) this._policyProperty.ToJson(null,serializationMode) : null, "policyProperties" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._scope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._scope.ToString()) : null, "scope" ,container.Add ); } AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); AddIf( null != this._isOrganizationDefault ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonBoolean((bool)this._isOrganizationDefault) : null, "isOrganizationDefault" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastModifiedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString(this._lastModifiedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedDateTime" ,container.Add ); } @@ -136,7 +136,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.J } container.Add("rules",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeRead)) { if (null != this._effectiveRule) { diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.PowerShell.cs similarity index 53% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.PowerShell.cs index 20cb327f4e8f..43997db4aa79 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyRule partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyRule(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyRule(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,45 +113,45 @@ internal RoleManagementPolicyRule(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, 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. @@ -158,39 +166,39 @@ internal RoleManagementPolicyRule(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Target, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTargetTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("RuleType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).RuleType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType = (string) content.GetValueForProperty("RuleType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).RuleType, global::System.Convert.ToString); } if (content.Contains("TargetCaller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller = (string) content.GetValueForProperty("TargetCaller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetCaller, global::System.Convert.ToString); } if (content.Contains("TargetOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation = (string[]) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation = (System.Collections.Generic.List) content.GetValueForProperty("TargetOperation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetOperation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel = (string) content.GetValueForProperty("TargetLevel",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetLevel, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetInheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (string[]) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetInheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetInheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("TargetEnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (string[]) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("TargetEnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal)this).TargetEnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -199,6 +207,18 @@ internal RoleManagementPolicyRule(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyRuleTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.TypeConverter.cs index 6fd7f0950b17..efd58d0ad6ff 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.cs similarity index 60% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.cs index 93601467ae24..d9b0b32bcdfe 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule. public partial class RoleManagementPolicyRule : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal { /// Backing field for property. @@ -21,45 +21,45 @@ public partial class RoleManagementPolicyRule : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for Target - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget()); set { {_target = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleInternal.Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget()); set { {_target = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType _ruleType; + private string _ruleType; /// The type of rule [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get => this._ruleType; set => this._ruleType = value; } + public string RuleType { get => this._ruleType; set => this._ruleType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget _target; + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget _target; /// The target of the current rule. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget()); set => this._target = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get => (this._target = this._target ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget()); set => this._target = value; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Caller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Caller = value ?? null; } + public string TargetCaller { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Caller; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Caller = value ?? null; } /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetEnforcedSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).EnforcedSetting = value ?? null /* arrayOf */; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetInheritableSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).InheritableSetting = value ?? null /* arrayOf */; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Level; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Level = value ?? null; } + public string TargetLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Level; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Level = value ?? null; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetObject { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).TargetObject = value ?? null /* arrayOf */; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Inlined)] - public string[] TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)Target).Operation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List TargetOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)Target).Operation = value ?? null /* arrayOf */; } /// Creates an new instance. public RoleManagementPolicyRule() @@ -75,6 +75,9 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The id of the rule.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -83,14 +86,21 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of rule", SerializedName = @"ruleType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("RoleManagementPolicyApprovalRule", "RoleManagementPolicyAuthenticationContextRule", "RoleManagementPolicyEnablementRule", "RoleManagementPolicyExpirationRule", "RoleManagementPolicyNotificationRule")] + string RuleType { get; set; } /// The caller of the setting. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The caller of the setting.", SerializedName = @"caller", PossibleTypes = new [] { typeof(string) })] @@ -99,22 +109,31 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enforced settings.", SerializedName = @"enforcedSettings", PossibleTypes = new [] { typeof(string) })] - string[] TargetEnforcedSetting { get; set; } + System.Collections.Generic.List TargetEnforcedSetting { get; set; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of inheritable settings.", SerializedName = @"inheritableSettings", PossibleTypes = new [] { typeof(string) })] - string[] TargetInheritableSetting { get; set; } + System.Collections.Generic.List TargetInheritableSetting { get; set; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The assignment level to which it is applied.", SerializedName = @"level", PossibleTypes = new [] { typeof(string) })] @@ -123,18 +142,24 @@ public partial interface IRoleManagementPolicyRule : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of target objects.", SerializedName = @"targetObjects", PossibleTypes = new [] { typeof(string) })] - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of operation.", SerializedName = @"operations", PossibleTypes = new [] { typeof(string) })] - string[] TargetOperation { get; set; } + System.Collections.Generic.List TargetOperation { get; set; } } /// The role management policy rule. @@ -144,21 +169,22 @@ internal partial interface IRoleManagementPolicyRuleInternal /// The id of the rule. string Id { get; set; } /// The type of rule - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RuleType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("RoleManagementPolicyApprovalRule", "RoleManagementPolicyAuthenticationContextRule", "RoleManagementPolicyEnablementRule", "RoleManagementPolicyExpirationRule", "RoleManagementPolicyNotificationRule")] + string RuleType { get; set; } /// The target of the current rule. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget Target { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget Target { get; set; } /// The caller of the setting. string TargetCaller { get; set; } /// The list of enforced settings. - string[] TargetEnforcedSetting { get; set; } + System.Collections.Generic.List TargetEnforcedSetting { get; set; } /// The list of inheritable settings. - string[] TargetInheritableSetting { get; set; } + System.Collections.Generic.List TargetInheritableSetting { get; set; } /// The assignment level to which it is applied. string TargetLevel { get; set; } /// The list of target objects. - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } /// The type of operation. - string[] TargetOperation { get; set; } + System.Collections.Generic.List TargetOperation { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.json.cs similarity index 92% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.json.cs index 66d578a72d5b..84aa481c02d5 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRule.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRule.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,16 +54,15 @@ public partial class RoleManagementPolicyRule partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule - /// interface is polymorphic, and the precise model class that will get deserialized is determined at runtime based on the - /// payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule interface is polymorphic, + /// and the precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json)) { @@ -109,9 +108,9 @@ internal RoleManagementPolicyRule(Microsoft.Azure.PowerShell.Cmdlets.Resources.A { return; } - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyRuleTarget.FromJson(__jsonTarget) : Target;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_ruleType = If( json?.PropertyT("ruleType"), out var __jsonRuleType) ? (string)__jsonRuleType : (string)RuleType;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyRuleTarget.FromJson(__jsonTarget) : _target;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_ruleType = If( json?.PropertyT("ruleType"), out var __jsonRuleType) ? (string)__jsonRuleType : (string)_ruleType;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.PowerShell.cs similarity index 59% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.PowerShell.cs index 804abe7bf975..19eb10376d68 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,37 @@ public partial class RoleManagementPolicyRuleTarget partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RoleManagementPolicyRuleTarget(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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RoleManagementPolicyRuleTarget(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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. @@ -105,33 +113,33 @@ internal RoleManagementPolicyRuleTarget(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Caller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation = (string[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (string[]) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("EnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (string[]) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, 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,27 +154,27 @@ internal RoleManagementPolicyRuleTarget(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Caller")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller = (string) content.GetValueForProperty("Caller",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Caller, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation = (string[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Level")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level = (string) content.GetValueForProperty("Level",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).Level, global::System.Convert.ToString); } if (content.Contains("TargetObject")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (string[]) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject = (System.Collections.Generic.List) content.GetValueForProperty("TargetObject",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).TargetObject, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InheritableSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (string[]) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting = (System.Collections.Generic.List) content.GetValueForProperty("InheritableSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).InheritableSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("EnforcedSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (string[]) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting = (System.Collections.Generic.List) content.GetValueForProperty("EnforcedSetting",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal)this).EnforcedSetting, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -175,6 +183,18 @@ internal RoleManagementPolicyRuleTarget(global::System.Management.Automation.PSO /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 role management policy rule target. [System.ComponentModel.TypeConverter(typeof(RoleManagementPolicyRuleTargetTypeConverter))] diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.TypeConverter.cs similarity index 96% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.TypeConverter.cs index 81aaa123a0f6..2f43805d6e86 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.cs similarity index 75% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.cs index 1ad42ed398c0..ba9a068b437d 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The role management policy rule target. public partial class RoleManagementPolicyRuleTarget : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTargetInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTargetInternal { /// Backing field for property. @@ -21,18 +21,18 @@ public partial class RoleManagementPolicyRuleTarget : public string Caller { get => this._caller; set => this._caller = value; } /// Backing field for property. - private string[] _enforcedSetting; + private System.Collections.Generic.List _enforcedSetting; /// The list of enforced settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] EnforcedSetting { get => this._enforcedSetting; set => this._enforcedSetting = value; } + public System.Collections.Generic.List EnforcedSetting { get => this._enforcedSetting; set => this._enforcedSetting = value; } /// Backing field for property. - private string[] _inheritableSetting; + private System.Collections.Generic.List _inheritableSetting; /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] InheritableSetting { get => this._inheritableSetting; set => this._inheritableSetting = value; } + public System.Collections.Generic.List InheritableSetting { get => this._inheritableSetting; set => this._inheritableSetting = value; } /// Backing field for property. private string _level; @@ -42,18 +42,18 @@ public partial class RoleManagementPolicyRuleTarget : public string Level { get => this._level; set => this._level = value; } /// Backing field for property. - private string[] _operation; + private System.Collections.Generic.List _operation; /// The type of operation. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] Operation { get => this._operation; set => this._operation = value; } + public System.Collections.Generic.List Operation { get => this._operation; set => this._operation = value; } /// Backing field for property. - private string[] _targetObject; + private System.Collections.Generic.List _targetObject; /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public string[] TargetObject { get => this._targetObject; set => this._targetObject = value; } + public System.Collections.Generic.List TargetObject { get => this._targetObject; set => this._targetObject = value; } /// Creates an new instance. public RoleManagementPolicyRuleTarget() @@ -69,6 +69,9 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The caller of the setting.", SerializedName = @"caller", PossibleTypes = new [] { typeof(string) })] @@ -77,22 +80,31 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of enforced settings.", SerializedName = @"enforcedSettings", PossibleTypes = new [] { typeof(string) })] - string[] EnforcedSetting { get; set; } + System.Collections.Generic.List EnforcedSetting { get; set; } /// The list of inheritable settings. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of inheritable settings.", SerializedName = @"inheritableSettings", PossibleTypes = new [] { typeof(string) })] - string[] InheritableSetting { get; set; } + System.Collections.Generic.List InheritableSetting { get; set; } /// The assignment level to which it is applied. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The assignment level to which it is applied.", SerializedName = @"level", PossibleTypes = new [] { typeof(string) })] @@ -101,18 +113,24 @@ public partial interface IRoleManagementPolicyRuleTarget : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of operation.", SerializedName = @"operations", PossibleTypes = new [] { typeof(string) })] - string[] Operation { get; set; } + System.Collections.Generic.List Operation { get; set; } /// The list of target objects. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of target objects.", SerializedName = @"targetObjects", PossibleTypes = new [] { typeof(string) })] - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } } /// The role management policy rule target. @@ -122,15 +140,15 @@ internal partial interface IRoleManagementPolicyRuleTargetInternal /// The caller of the setting. string Caller { get; set; } /// The list of enforced settings. - string[] EnforcedSetting { get; set; } + System.Collections.Generic.List EnforcedSetting { get; set; } /// The list of inheritable settings. - string[] InheritableSetting { get; set; } + System.Collections.Generic.List InheritableSetting { get; set; } /// The assignment level to which it is applied. string Level { get; set; } /// The type of operation. - string[] Operation { get; set; } + System.Collections.Generic.List Operation { get; set; } /// The list of target objects. - string[] TargetObject { get; set; } + System.Collections.Generic.List TargetObject { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.json.cs similarity index 86% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.json.cs index 50efdd233ad4..c98828cffd2a 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/RoleManagementPolicyRuleTarget.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/RoleManagementPolicyRuleTarget.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RoleManagementPolicyRuleTarget partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRuleTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRuleTarget FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new RoleManagementPolicyRuleTarget(json) : null; } @@ -77,12 +77,12 @@ internal RoleManagementPolicyRuleTarget(Microsoft.Azure.PowerShell.Cmdlets.Resou { return; } - {_caller = If( json?.PropertyT("caller"), out var __jsonCaller) ? (string)__jsonCaller : (string)Caller;} - {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Operation;} - {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)Level;} - {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : TargetObject;} - {_inheritableSetting = If( json?.PropertyT("inheritableSettings"), out var __jsonInheritableSettings) ? If( __jsonInheritableSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : InheritableSetting;} - {_enforcedSetting = If( json?.PropertyT("enforcedSettings"), out var __jsonEnforcedSettings) ? If( __jsonEnforcedSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : EnforcedSetting;} + {_caller = If( json?.PropertyT("caller"), out var __jsonCaller) ? (string)__jsonCaller : (string)_caller;} + {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _operation;} + {_level = If( json?.PropertyT("level"), out var __jsonLevel) ? (string)__jsonLevel : (string)_level;} + {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _targetObject;} + {_inheritableSetting = If( json?.PropertyT("inheritableSettings"), out var __jsonInheritableSettings) ? If( __jsonInheritableSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _inheritableSetting;} + {_enforcedSetting = If( json?.PropertyT("enforcedSettings"), out var __jsonEnforcedSettings) ? If( __jsonEnforcedSettings as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _enforcedSetting;} AfterFromJson(json); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.PowerShell.cs similarity index 68% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.PowerShell.cs index d33fbe813b1c..c62412cc0b0f 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.PowerShell.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class UserSet partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of 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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UserSet(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.Resources.Authorization.Models.Api20201001Preview.IUserSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UserSet(content); } @@ -87,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models. /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -110,25 +128,25 @@ internal UserSet(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("UserType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType?) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType = (string) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType, global::System.Convert.ToString); } if (content.Contains("IsBackup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)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. @@ -143,19 +161,19 @@ internal UserSet(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("UserType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType = (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType?) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).UserType, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType = (string) content.GetValueForProperty("UserType",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).UserType, global::System.Convert.ToString); } if (content.Contains("IsBackup")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup = (bool?) content.GetValueForProperty("IsBackup",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).IsBackup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.TypeConverter.cs similarity index 97% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.TypeConverter.cs index 48bf009b6354..111ad4105eee 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.TypeConverter.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.Api20201001Preview.IUserSet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.cs similarity index 84% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.cs index f1e2e64366ad..cd390ea20200 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; /// The detail of a user. public partial class UserSet : - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSetInternal + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSetInternal { /// Backing field for property. @@ -35,11 +35,11 @@ public partial class UserSet : public bool? IsBackup { get => this._isBackup; set => this._isBackup = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? _userType; + private string _userType; /// The type of user. [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get => this._userType; set => this._userType = value; } + public string UserType { get => this._userType; set => this._userType = value; } /// Creates an new instance. public UserSet() @@ -55,6 +55,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The description of the user.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The object id of the user.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value indicating whether the user is a backup fallback approver", SerializedName = @"isBackup", PossibleTypes = new [] { typeof(bool) })] @@ -79,10 +88,14 @@ public partial interface IUserSet : [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of user.", SerializedName = @"userType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group")] + string UserType { get; set; } } /// The detail of a user. @@ -96,7 +109,8 @@ internal partial interface IUserSetInternal /// The value indicating whether the user is a backup fallback approver bool? IsBackup { get; set; } /// The type of user. - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType? UserType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("User", "Group")] + string UserType { get; set; } } } \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.json.cs similarity index 95% rename from generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs rename to generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.json.cs index e4c82f4af948..258b8fa611ce 100644 --- a/generated/Resources/Authorization.Autorest/generated/api/Models/Api20201001Preview/UserSet.json.cs +++ b/generated/Resources/Authorization.Autorest/generated/api/Models/UserSet.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.Resources.Authorization.Models.Api20201001Preview +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UserSet partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IUserSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IUserSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Json.JsonObject json ? new UserSet(json) : null; } @@ -104,10 +104,10 @@ internal UserSet(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runt { return; } - {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)UserType;} - {_isBackup = If( json?.PropertyT("isBackup"), out var __jsonIsBackup) ? (bool?)__jsonIsBackup : IsBackup;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)_userType;} + {_isBackup = If( json?.PropertyT("isBackup"), out var __jsonIsBackup) ? (bool?)__jsonIsBackup : _isBackup;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } } diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.Completer.cs deleted file mode 100644 index 6d41dd0165e0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.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.Resources.Authorization.Support -{ - - /// The type of rule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalModeTypeConverter))] - public partial struct ApprovalMode : - 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) || "SingleStage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SingleStage'", "SingleStage", global::System.Management.Automation.CompletionResultType.ParameterValue, "SingleStage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Serial".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Serial'", "Serial", global::System.Management.Automation.CompletionResultType.ParameterValue, "Serial"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Parallel".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Parallel'", "Parallel", global::System.Management.Automation.CompletionResultType.ParameterValue, "Parallel"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoApproval".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoApproval'", "NoApproval", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoApproval"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.TypeConverter.cs deleted file mode 100644 index 28e93ae76e6f..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.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.Resources.Authorization.Support -{ - - /// The type of rule - public partial class ApprovalModeTypeConverter : - 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) => ApprovalMode.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/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.cs deleted file mode 100644 index 859f3024d5da..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/ApprovalMode.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.Resources.Authorization.Support -{ - - /// The type of rule - public partial struct ApprovalMode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode NoApproval = @"NoApproval"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode Parallel = @"Parallel"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode Serial = @"Serial"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode SingleStage = @"SingleStage"; - - /// 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 ApprovalMode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ApprovalMode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ApprovalMode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ApprovalMode (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 ApprovalMode && Equals((ApprovalMode)obj); - } - - /// Returns hashCode for enum ApprovalMode - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ApprovalMode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ApprovalMode - /// the value to convert to an instance of . - - public static implicit operator ApprovalMode(string value) - { - return new ApprovalMode(value); - } - - /// Implicit operator to convert ApprovalMode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e) - { - return e._value; - } - - /// Overriding != operator for enum ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ApprovalMode - /// 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.Resources.Authorization.Support.ApprovalMode e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.ApprovalMode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.Completer.cs deleted file mode 100644 index f98767fd3c20..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.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.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentTypeTypeConverter))] - public partial struct AssignmentType : - 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) || "Activated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Activated'", "Activated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Activated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Assigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Assigned'", "Assigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Assigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.TypeConverter.cs deleted file mode 100644 index 0f6474ea1226..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.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.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - public partial class AssignmentTypeTypeConverter : - 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) => AssignmentType.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/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.cs deleted file mode 100644 index 0b265e86f4ad..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/AssignmentType.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.Resources.Authorization.Support -{ - - /// Assignment type of the role assignment schedule - public partial struct AssignmentType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType Activated = @"Activated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType Assigned = @"Assigned"; - - /// 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 AssignmentType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AssignmentType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AssignmentType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AssignmentType (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 AssignmentType && Equals((AssignmentType)obj); - } - - /// Returns hashCode for enum AssignmentType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AssignmentType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AssignmentType - /// the value to convert to an instance of . - - public static implicit operator AssignmentType(string value) - { - return new AssignmentType(value); - } - - /// Implicit operator to convert AssignmentType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e) - { - return e._value; - } - - /// Overriding != operator for enum AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AssignmentType - /// 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.Resources.Authorization.Support.AssignmentType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.AssignmentType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.Completer.cs deleted file mode 100644 index 52c6fff8aea1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.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.Resources.Authorization.Support -{ - - /// The type of enable rules - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRulesTypeConverter))] - public partial struct EnablementRules : - 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) || "MultiFactorAuthentication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MultiFactorAuthentication'", "MultiFactorAuthentication", global::System.Management.Automation.CompletionResultType.ParameterValue, "MultiFactorAuthentication"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Justification".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Justification'", "Justification", global::System.Management.Automation.CompletionResultType.ParameterValue, "Justification"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Ticketing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Ticketing'", "Ticketing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ticketing"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.TypeConverter.cs deleted file mode 100644 index e5dc627a41cd..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.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.Resources.Authorization.Support -{ - - /// The type of enable rules - public partial class EnablementRulesTypeConverter : - 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) => EnablementRules.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/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs deleted file mode 100644 index 5a8fcead0c27..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/EnablementRules.cs +++ /dev/null @@ -1,100 +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.Resources.Authorization.Support -{ - - /// The type of enable rules - public partial struct EnablementRules : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules Justification = @"Justification"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules MultiFactorAuthentication = @"MultiFactorAuthentication"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules Ticketing = @"Ticketing"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EnablementRules - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EnablementRules(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EnablementRules(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EnablementRules (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 EnablementRules && Equals((EnablementRules)obj); - } - - /// Returns hashCode for enum EnablementRules - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EnablementRules - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EnablementRules - /// the value to convert to an instance of . - - public static implicit operator EnablementRules(string value) - { - return new EnablementRules(value); - } - - /// Implicit operator to convert EnablementRules to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e) - { - return e._value; - } - - /// Overriding != operator for enum EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EnablementRules - /// 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.Resources.Authorization.Support.EnablementRules e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.EnablementRules e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.Completer.cs deleted file mode 100644 index ab01fe121926..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.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.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberTypeTypeConverter))] - public partial struct MemberType : - 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) || "Inherited".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Inherited'", "Inherited", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inherited"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Direct".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Direct'", "Direct", global::System.Management.Automation.CompletionResultType.ParameterValue, "Direct"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.TypeConverter.cs deleted file mode 100644 index e4f4a4d719a7..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.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.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - public partial class MemberTypeTypeConverter : - 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) => MemberType.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/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs deleted file mode 100644 index b6a8364f7293..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/MemberType.cs +++ /dev/null @@ -1,100 +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.Resources.Authorization.Support -{ - - /// Membership type of the role assignment schedule - public partial struct MemberType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Direct = @"Direct"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType Inherited = @"Inherited"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MemberType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MemberType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MemberType - /// 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.Resources.Authorization.Support.MemberType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MemberType (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 MemberType && Equals((MemberType)obj); - } - - /// Returns hashCode for enum MemberType - /// 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 MemberType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MemberType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MemberType - /// the value to convert to an instance of . - - public static implicit operator MemberType(string value) - { - return new MemberType(value); - } - - /// Implicit operator to convert MemberType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e) - { - return e._value; - } - - /// Overriding != operator for enum MemberType - /// 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.Resources.Authorization.Support.MemberType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MemberType - /// 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.Resources.Authorization.Support.MemberType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.MemberType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs deleted file mode 100644 index a0673560fb1a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.Completer.cs +++ /dev/null @@ -1,35 +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.Resources.Authorization.Support -{ - - /// The type of notification. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanismTypeConverter))] - public partial struct NotificationDeliveryMechanism : - 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) || "Email".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Email'", "Email", global::System.Management.Automation.CompletionResultType.ParameterValue, "Email"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.TypeConverter.cs deleted file mode 100644 index fd41b8a926cd..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.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.Resources.Authorization.Support -{ - - /// The type of notification. - public partial class NotificationDeliveryMechanismTypeConverter : - 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) => NotificationDeliveryMechanism.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/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.cs deleted file mode 100644 index 9ee533a3139d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationDeliveryMechanism.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.Resources.Authorization.Support -{ - - /// The type of notification. - public partial struct NotificationDeliveryMechanism : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism Email = @"Email"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to NotificationDeliveryMechanism - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new NotificationDeliveryMechanism(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type NotificationDeliveryMechanism (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 NotificationDeliveryMechanism && Equals((NotificationDeliveryMechanism)obj); - } - - /// Returns hashCode for enum NotificationDeliveryMechanism - /// 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 NotificationDeliveryMechanism(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for NotificationDeliveryMechanism - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to NotificationDeliveryMechanism - /// the value to convert to an instance of . - - public static implicit operator NotificationDeliveryMechanism(string value) - { - return new NotificationDeliveryMechanism(value); - } - - /// Implicit operator to convert NotificationDeliveryMechanism to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e) - { - return e._value; - } - - /// Overriding != operator for enum NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum NotificationDeliveryMechanism - /// 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.Resources.Authorization.Support.NotificationDeliveryMechanism e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationDeliveryMechanism e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.Completer.cs deleted file mode 100644 index 30d13a8b4134..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.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.Resources.Authorization.Support -{ - - /// The notification level. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevelTypeConverter))] - public partial struct NotificationLevel : - 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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Critical".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Critical'", "Critical", global::System.Management.Automation.CompletionResultType.ParameterValue, "Critical"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "All".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'All'", "All", global::System.Management.Automation.CompletionResultType.ParameterValue, "All"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.TypeConverter.cs deleted file mode 100644 index 3d43978ca4a2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.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.Resources.Authorization.Support -{ - - /// The notification level. - public partial class NotificationLevelTypeConverter : - 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) => NotificationLevel.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/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs deleted file mode 100644 index f36e415e51a0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/NotificationLevel.cs +++ /dev/null @@ -1,100 +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.Resources.Authorization.Support -{ - - /// The notification level. - public partial struct NotificationLevel : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel All = @"All"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel Critical = @"Critical"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel None = @"None"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to NotificationLevel - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new NotificationLevel(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type NotificationLevel (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 NotificationLevel && Equals((NotificationLevel)obj); - } - - /// Returns hashCode for enum NotificationLevel - /// 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 NotificationLevel(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for NotificationLevel - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to NotificationLevel - /// the value to convert to an instance of . - - public static implicit operator NotificationLevel(string value) - { - return new NotificationLevel(value); - } - - /// Implicit operator to convert NotificationLevel to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e) - { - return e._value; - } - - /// Overriding != operator for enum NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum NotificationLevel - /// 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.Resources.Authorization.Support.NotificationLevel e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.NotificationLevel e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs deleted file mode 100644 index a7e8633c5407..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.Completer.cs +++ /dev/null @@ -1,75 +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.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalTypeTypeConverter))] - public partial struct PrincipalType : - 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) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServicePrincipal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ServicePrincipal'", "ServicePrincipal", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServicePrincipal"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectoryRoleTemplate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectoryRoleTemplate'", "DirectoryRoleTemplate", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectoryRoleTemplate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ForeignGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ForeignGroup'", "ForeignGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ForeignGroup"); - } - 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) || "MSI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MSI'", "MSI", global::System.Management.Automation.CompletionResultType.ParameterValue, "MSI"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DirectoryObjectOrGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DirectoryObjectOrGroup'", "DirectoryObjectOrGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "DirectoryObjectOrGroup"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Everyone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Everyone'", "Everyone", global::System.Management.Automation.CompletionResultType.ParameterValue, "Everyone"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Device".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Device'", "Device", global::System.Management.Automation.CompletionResultType.ParameterValue, "Device"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.TypeConverter.cs deleted file mode 100644 index d5e9b748c3f2..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.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.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - public partial class PrincipalTypeTypeConverter : - 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) => PrincipalType.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/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs deleted file mode 100644 index 94fe7601f15d..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/PrincipalType.cs +++ /dev/null @@ -1,116 +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.Resources.Authorization.Support -{ - - /// The principal type of the assigned principal ID. - public partial struct PrincipalType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Device = @"Device"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType DirectoryObjectOrGroup = @"DirectoryObjectOrGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType DirectoryRoleTemplate = @"DirectoryRoleTemplate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Everyone = @"Everyone"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType ForeignGroup = @"ForeignGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Msi = @"MSI"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType ServicePrincipal = @"ServicePrincipal"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType Unknown = @"Unknown"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PrincipalType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrincipalType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PrincipalType (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 PrincipalType && Equals((PrincipalType)obj); - } - - /// Returns hashCode for enum PrincipalType - /// 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 PrincipalType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrincipalType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrincipalType - /// the value to convert to an instance of . - - public static implicit operator PrincipalType(string value) - { - return new PrincipalType(value); - } - - /// Implicit operator to convert PrincipalType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e) - { - return e._value; - } - - /// Overriding != operator for enum PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrincipalType - /// 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.Resources.Authorization.Support.PrincipalType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.PrincipalType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.Completer.cs deleted file mode 100644 index c3dbd517ed68..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.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.Resources.Authorization.Support -{ - - /// The recipient type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientTypeTypeConverter))] - public partial struct RecipientType : - 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) || "Requestor".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Requestor'", "Requestor", global::System.Management.Automation.CompletionResultType.ParameterValue, "Requestor"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approver".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Approver'", "Approver", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approver"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Admin".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Admin'", "Admin", global::System.Management.Automation.CompletionResultType.ParameterValue, "Admin"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.TypeConverter.cs deleted file mode 100644 index 6aae6361864a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.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.Resources.Authorization.Support -{ - - /// The recipient type. - public partial class RecipientTypeTypeConverter : - 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) => RecipientType.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/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs deleted file mode 100644 index 30e6cfd27c15..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RecipientType.cs +++ /dev/null @@ -1,100 +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.Resources.Authorization.Support -{ - - /// The recipient type. - public partial struct RecipientType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Admin = @"Admin"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Approver = @"Approver"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType Requestor = @"Requestor"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RecipientType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RecipientType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RecipientType - /// 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.Resources.Authorization.Support.RecipientType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RecipientType (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 RecipientType && Equals((RecipientType)obj); - } - - /// Returns hashCode for enum RecipientType - /// 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 RecipientType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RecipientType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RecipientType - /// the value to convert to an instance of . - - public static implicit operator RecipientType(string value) - { - return new RecipientType(value); - } - - /// Implicit operator to convert RecipientType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e) - { - return e._value; - } - - /// Overriding != operator for enum RecipientType - /// 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.Resources.Authorization.Support.RecipientType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RecipientType - /// 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.Resources.Authorization.Support.RecipientType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RecipientType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs deleted file mode 100644 index 7fb03413e2b7..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.Completer.cs +++ /dev/null @@ -1,69 +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.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestTypeTypeConverter))] - public partial struct RequestType : - 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) || "AdminAssign".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminAssign'", "AdminAssign", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminAssign"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminRemove".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminRemove'", "AdminRemove", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminRemove"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminUpdate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminUpdate'", "AdminUpdate", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminUpdate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminExtend".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminExtend'", "AdminExtend", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminExtend"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminRenew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminRenew'", "AdminRenew", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminRenew"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfActivate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfActivate'", "SelfActivate", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfActivate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfDeactivate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfDeactivate'", "SelfDeactivate", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfDeactivate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfExtend".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfExtend'", "SelfExtend", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfExtend"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfRenew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfRenew'", "SelfRenew", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfRenew"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.TypeConverter.cs deleted file mode 100644 index 711434d50fd9..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.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.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - public partial class RequestTypeTypeConverter : - 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) => RequestType.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/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs deleted file mode 100644 index f655be82926e..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RequestType.cs +++ /dev/null @@ -1,114 +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.Resources.Authorization.Support -{ - - /// - /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc - /// - public partial struct RequestType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminAssign = @"AdminAssign"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminExtend = @"AdminExtend"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminRemove = @"AdminRemove"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminRenew = @"AdminRenew"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType AdminUpdate = @"AdminUpdate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfActivate = @"SelfActivate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfDeactivate = @"SelfDeactivate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfExtend = @"SelfExtend"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType SelfRenew = @"SelfRenew"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RequestType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RequestType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RequestType - /// 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.Resources.Authorization.Support.RequestType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RequestType (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 RequestType && Equals((RequestType)obj); - } - - /// Returns hashCode for enum RequestType - /// 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 RequestType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RequestType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RequestType - /// the value to convert to an instance of . - - public static implicit operator RequestType(string value) - { - return new RequestType(value); - } - - /// Implicit operator to convert RequestType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e) - { - return e._value; - } - - /// Overriding != operator for enum RequestType - /// 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.Resources.Authorization.Support.RequestType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RequestType - /// 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.Resources.Authorization.Support.RequestType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs deleted file mode 100644 index 339291a8ac66..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.Completer.cs +++ /dev/null @@ -1,51 +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.Resources.Authorization.Support -{ - - /// The type of rule - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleTypeTypeConverter))] - public partial struct RoleManagementPolicyRuleType : - 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) || "RoleManagementPolicyApprovalRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyApprovalRule'", "RoleManagementPolicyApprovalRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyApprovalRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyAuthenticationContextRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyAuthenticationContextRule'", "RoleManagementPolicyAuthenticationContextRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyAuthenticationContextRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyEnablementRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyEnablementRule'", "RoleManagementPolicyEnablementRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyEnablementRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyExpirationRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyExpirationRule'", "RoleManagementPolicyExpirationRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyExpirationRule"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleManagementPolicyNotificationRule".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleManagementPolicyNotificationRule'", "RoleManagementPolicyNotificationRule", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleManagementPolicyNotificationRule"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.TypeConverter.cs deleted file mode 100644 index 2f3b12c9b716..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.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.Resources.Authorization.Support -{ - - /// The type of rule - public partial class RoleManagementPolicyRuleTypeTypeConverter : - 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) => RoleManagementPolicyRuleType.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/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs deleted file mode 100644 index a662c163885c..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/RoleManagementPolicyRuleType.cs +++ /dev/null @@ -1,108 +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.Resources.Authorization.Support -{ - - /// The type of rule - public partial struct RoleManagementPolicyRuleType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyApprovalRule = @"RoleManagementPolicyApprovalRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyAuthenticationContextRule = @"RoleManagementPolicyAuthenticationContextRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyEnablementRule = @"RoleManagementPolicyEnablementRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyExpirationRule = @"RoleManagementPolicyExpirationRule"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType RoleManagementPolicyNotificationRule = @"RoleManagementPolicyNotificationRule"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to RoleManagementPolicyRuleType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RoleManagementPolicyRuleType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RoleManagementPolicyRuleType (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 RoleManagementPolicyRuleType && Equals((RoleManagementPolicyRuleType)obj); - } - - /// Returns hashCode for enum RoleManagementPolicyRuleType - /// 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 RoleManagementPolicyRuleType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RoleManagementPolicyRuleType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RoleManagementPolicyRuleType - /// the value to convert to an instance of . - - public static implicit operator RoleManagementPolicyRuleType(string value) - { - return new RoleManagementPolicyRuleType(value); - } - - /// Implicit operator to convert RoleManagementPolicyRuleType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e) - { - return e._value; - } - - /// Overriding != operator for enum RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RoleManagementPolicyRuleType - /// 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.Resources.Authorization.Support.RoleManagementPolicyRuleType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RoleManagementPolicyRuleType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs deleted file mode 100644 index 1c4b6595c1a5..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.Completer.cs +++ /dev/null @@ -1,119 +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.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.StatusTypeConverter))] - public partial struct Status : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingEvaluation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingEvaluation'", "PendingEvaluation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingEvaluation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Granted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Granted'", "Granted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Granted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Denied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Denied'", "Denied", global::System.Management.Automation.CompletionResultType.ParameterValue, "Denied"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingProvisioning'", "PendingProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingProvisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioned'", "Provisioned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingRevocation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingRevocation'", "PendingRevocation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingRevocation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Revoked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Revoked'", "Revoked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Revoked"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Canceled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Canceled'", "Canceled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Canceled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "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) || "PendingApprovalProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingApprovalProvisioning'", "PendingApprovalProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingApprovalProvisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingApproval".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingApproval'", "PendingApproval", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingApproval"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FailedAsResourceIsLocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FailedAsResourceIsLocked'", "FailedAsResourceIsLocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "FailedAsResourceIsLocked"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingAdminDecision".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingAdminDecision'", "PendingAdminDecision", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingAdminDecision"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminApproved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminApproved'", "AdminApproved", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminApproved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AdminDenied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AdminDenied'", "AdminDenied", global::System.Management.Automation.CompletionResultType.ParameterValue, "AdminDenied"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TimedOut".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TimedOut'", "TimedOut", global::System.Management.Automation.CompletionResultType.ParameterValue, "TimedOut"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProvisioningStarted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ProvisioningStarted'", "ProvisioningStarted", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProvisioningStarted"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Invalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Invalid'", "Invalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "Invalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingScheduleCreation".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingScheduleCreation'", "PendingScheduleCreation", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingScheduleCreation"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ScheduleCreated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ScheduleCreated'", "ScheduleCreated", global::System.Management.Automation.CompletionResultType.ParameterValue, "ScheduleCreated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingExternalProvisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingExternalProvisioning'", "PendingExternalProvisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingExternalProvisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.TypeConverter.cs deleted file mode 100644 index c4dafa33eeb1..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.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.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - public partial class StatusTypeConverter : - 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) => Status.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/Resources/Authorization.Autorest/generated/api/Support/Status.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Status.cs deleted file mode 100644 index b276b054ab63..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Status.cs +++ /dev/null @@ -1,138 +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.Resources.Authorization.Support -{ - - /// The status of the role assignment schedule. - public partial struct Status : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status AdminApproved = @"AdminApproved"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status AdminDenied = @"AdminDenied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Denied = @"Denied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status FailedAsResourceIsLocked = @"FailedAsResourceIsLocked"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Granted = @"Granted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Invalid = @"Invalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingAdminDecision = @"PendingAdminDecision"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingApproval = @"PendingApproval"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingApprovalProvisioning = @"PendingApprovalProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingEvaluation = @"PendingEvaluation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingExternalProvisioning = @"PendingExternalProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingProvisioning = @"PendingProvisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingRevocation = @"PendingRevocation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status PendingScheduleCreation = @"PendingScheduleCreation"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Provisioned = @"Provisioned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status ProvisioningStarted = @"ProvisioningStarted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status Revoked = @"Revoked"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status ScheduleCreated = @"ScheduleCreated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status TimedOut = @"TimedOut"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Status - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Status(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Status - /// 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.Resources.Authorization.Support.Status e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Status (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 Status && Equals((Status)obj); - } - - /// Returns hashCode for enum Status - /// 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 Status(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Status - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Status - /// the value to convert to an instance of . - - public static implicit operator Status(string value) - { - return new Status(value); - } - - /// Implicit operator to convert Status to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e) - { - return e._value; - } - - /// Overriding != operator for enum Status - /// 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.Resources.Authorization.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Status - /// 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.Resources.Authorization.Support.Status e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Status e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.Completer.cs deleted file mode 100644 index eb42bed154f0..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.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.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.TypeTypeConverter))] - public partial struct Type : - 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) || "AfterDuration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AfterDuration'", "AfterDuration", global::System.Management.Automation.CompletionResultType.ParameterValue, "AfterDuration"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AfterDateTime".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AfterDateTime'", "AfterDateTime", global::System.Management.Automation.CompletionResultType.ParameterValue, "AfterDateTime"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoExpiration".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoExpiration'", "NoExpiration", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoExpiration"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.TypeConverter.cs deleted file mode 100644 index 910feefa97ee..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.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.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - public partial class TypeTypeConverter : - 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) => Type.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/Resources/Authorization.Autorest/generated/api/Support/Type.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/Type.cs deleted file mode 100644 index bfb2806a4b1a..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/Type.cs +++ /dev/null @@ -1,100 +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.Resources.Authorization.Support -{ - - /// Type of the role assignment schedule expiration - public partial struct Type : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type AfterDateTime = @"AfterDateTime"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type AfterDuration = @"AfterDuration"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type NoExpiration = @"NoExpiration"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Type - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Type(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Type - /// 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.Resources.Authorization.Support.Type e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Type (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 Type && Equals((Type)obj); - } - - /// Returns hashCode for enum Type - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for Type - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Type(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to Type - /// the value to convert to an instance of . - - public static implicit operator Type(string value) - { - return new Type(value); - } - - /// Implicit operator to convert Type to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e) - { - return e._value; - } - - /// Overriding != operator for enum Type - /// 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.Resources.Authorization.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Type - /// 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.Resources.Authorization.Support.Type e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.Completer.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.Completer.cs deleted file mode 100644 index a3be735cd716..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.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.Resources.Authorization.Support -{ - - /// The type of user. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserTypeTypeConverter))] - public partial struct UserType : - 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) || "Group".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Group'", "Group", global::System.Management.Automation.CompletionResultType.ParameterValue, "Group"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.TypeConverter.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.TypeConverter.cs deleted file mode 100644 index 163527978c83..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.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.Resources.Authorization.Support -{ - - /// The type of user. - public partial class UserTypeTypeConverter : - 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) => UserType.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/Resources/Authorization.Autorest/generated/api/Support/UserType.cs b/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.cs deleted file mode 100644 index 729249742513..000000000000 --- a/generated/Resources/Authorization.Autorest/generated/api/Support/UserType.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.Resources.Authorization.Support -{ - - /// The type of user. - public partial struct UserType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType Group = @"Group"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to UserType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new UserType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type UserType - /// 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.Resources.Authorization.Support.UserType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type UserType (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 UserType && Equals((UserType)obj); - } - - /// Returns hashCode for enum UserType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for UserType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private UserType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to UserType - /// the value to convert to an instance of . - - public static implicit operator UserType(string value) - { - return new UserType(value); - } - - /// Implicit operator to convert UserType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e) - { - return e._value; - } - - /// Overriding != operator for enum UserType - /// 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.Resources.Authorization.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum UserType - /// 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.Resources.Authorization.Support.UserType e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.UserType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs index 429f6f0803df..be4721639240 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role assignment schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_Get : global::System.Ma /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs index 57923bee8811..71fb09270558 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role assignment schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role assignment schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_GetViaIdentity : global /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs index 7ac7823d83f2..3c14880e2d54 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleInstance_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedule instances of a role assignment schedule. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleInstance_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule instances of a role assignment schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,24 +161,24 @@ public partial class GetAzRoleAssignmentScheduleInstance_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleInstance_List() { @@ -252,8 +278,33 @@ public GetAzRoleAssignmentScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -384,15 +435,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult /// 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 ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleInstanceListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs index 17c7d54d1665..f0e686e9e24e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_Get : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs index 1acd1dec2eab..558de3c48a7d 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_GetViaIdentity : global: /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs index abce2dee5433..37322b60fccb 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentScheduleRequest_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedule requests for a scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentScheduleRequest_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -104,7 +125,7 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -141,24 +162,24 @@ public partial class GetAzRoleAssignmentScheduleRequest_List : global::System.Ma /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult /// 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) @@ -181,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -202,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentScheduleRequest_List() { @@ -253,8 +279,33 @@ public GetAzRoleAssignmentScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -307,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,12 +414,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -385,15 +436,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -403,12 +454,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult /// 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 ) { @@ -420,15 +471,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequestListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs index aaa59ec8222e..ee582fc47e1a 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleAssignmentSchedule_Get : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleAssignmentSchedule_Get : 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_Get() { @@ -242,8 +268,33 @@ public GetAzRoleAssignmentSchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs index 81057ce041c7..4595b3d5d58e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role assignment schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role assignment schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleAssignmentSchedule_GetViaIdentity : 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleAssignmentSchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs index 705963db42c6..f404f1748171 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleAssignmentSchedule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role assignment schedules for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleAssignmentSchedule_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentSchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentSchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role assignment schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleAssignmentSchedule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,24 +161,24 @@ public partial class GetAzRoleAssignmentSchedule_List : global::System.Managemen /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleAssignmentSchedule_List() { @@ -252,8 +278,33 @@ public GetAzRoleAssignmentSchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -384,15 +435,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult /// 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 ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs index 1493a9f81915..1d4a11a83149 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role eligibility schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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] @@ -95,7 +116,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -132,24 +153,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_Get : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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) @@ -172,6 +193,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,7 +219,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_Get() { @@ -244,8 +270,33 @@ public GetAzRoleEligibilityScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -298,7 +349,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +405,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -376,15 +427,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -394,12 +445,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,8 +462,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs index 3c1abf14ae47..43d009461fda 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets the specified role eligibility schedule instance. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets the specified role eligibility schedule instance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_GetViaIdentity : globa /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilityScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs index ff971b526b84..4395c59074be 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleInstance_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedule instances of a role eligibility schedule. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleInstance_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstance))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule instances of a role eligibility schedule.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleInstance_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,24 +161,24 @@ public partial class GetAzRoleEligibilityScheduleInstance_List : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleInstance_List() { @@ -252,8 +278,33 @@ public GetAzRoleEligibilityScheduleInstance_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -384,15 +435,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleInstanceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult /// 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 ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleInstanceListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs index 51cb36c485ae..8712dfd6adcf 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_Get : global::System.Ma /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_Get() { @@ -242,8 +268,33 @@ public GetAzRoleEligibilityScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs index f4274c915a14..915e0a5d05c7 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule request. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_GetViaIdentity : global /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilityScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs index 804b2c7e6308..4b30d461c399 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilityScheduleRequest_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedule requests for a scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilityScheduleRequest_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedule requests for a scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -104,7 +125,7 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -141,24 +162,24 @@ public partial class GetAzRoleEligibilityScheduleRequest_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult /// 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) @@ -181,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -202,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilityScheduleRequest_List() { @@ -253,8 +279,33 @@ public GetAzRoleEligibilityScheduleRequest_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -307,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -325,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,12 +414,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -385,15 +436,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -403,12 +454,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequestListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult /// 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 ) { @@ -420,15 +471,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequestListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs index b4a3f0ebf257..610f440058f2 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleEligibilitySchedule_Get : global::System.Managemen /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_Get() { @@ -242,8 +268,33 @@ public GetAzRoleEligibilitySchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs index 701b708b9926..fc2a4eb88574 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role eligibility schedule for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role eligibility schedule for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleEligibilitySchedule_GetViaIdentity : global::Syste /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleEligibilitySchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs index 8edba77dd31e..65865a9e6266 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibilitySchedule_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role eligibility schedules for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibilitySchedule_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilitySchedule))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilitySchedule))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role eligibility schedules for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibilitySchedule_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -103,7 +124,7 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,24 +161,24 @@ public partial class GetAzRoleEligibilitySchedule_List : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult /// 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 +201,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +227,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibilitySchedule_List() { @@ -252,8 +278,33 @@ public GetAzRoleEligibilitySchedule_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,12 +413,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -384,15 +435,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -402,12 +453,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult /// 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 ) { @@ -419,15 +470,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs index 297a2b811358..24e63d944f91 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the child resources of a resource on which user has eligible access @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/eligibleChildResources" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibleChildResource_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleEligibleChildResource_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -102,7 +123,7 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,24 +160,24 @@ public partial class GetAzRoleEligibleChildResource_Get : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -179,6 +200,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -200,7 +226,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleEligibleChildResource_Get() { @@ -251,8 +277,33 @@ public GetAzRoleEligibleChildResource_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -305,7 +356,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,12 +412,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -383,15 +434,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -401,12 +452,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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult /// 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 ) { @@ -418,15 +469,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IEligibleChildResourcesListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs index 44f9fca25201..6a517fcc9bcd 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy assignment for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -130,24 +151,24 @@ public partial class GetAzRoleManagementPolicyAssignment_Get : global::System.Ma /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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) @@ -170,6 +191,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_Get() { @@ -242,8 +268,33 @@ public GetAzRoleManagementPolicyAssignment_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs index c16034f7ed22..083866b564b1 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy assignment for a resource scope @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy assignment for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -109,24 +130,24 @@ public partial class GetAzRoleManagementPolicyAssignment_GetViaIdentity : global /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzRoleManagementPolicyAssignment_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -347,12 +398,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -369,7 +420,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -387,12 +438,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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 ) { @@ -404,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs index 774ad527b8de..791262abd377 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicyAssignment_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role management assignment policies for a resource scope. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicyAssignment_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management assignment policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicyAssignment_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -121,24 +142,24 @@ public partial class GetAzRoleManagementPolicyAssignment_List : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult /// 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) @@ -161,6 +182,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -182,7 +208,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicyAssignment_List() { @@ -233,8 +259,33 @@ public GetAzRoleManagementPolicyAssignment_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -287,7 +338,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,7 +356,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -343,12 +394,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -365,15 +416,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope }) + 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 } }); @@ -383,12 +434,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignmentListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult /// 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 ) { @@ -400,15 +451,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignmentListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs index 8097c0a5b90c..1fe1b3b6160e 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy for a resource scope @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_Get : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_Get : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,24 +152,24 @@ public partial class GetAzRoleManagementPolicy_Get : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) @@ -171,6 +192,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -192,7 +218,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicy_Get() { @@ -243,8 +269,33 @@ public GetAzRoleManagementPolicy_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -297,7 +348,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -315,7 +366,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,12 +404,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -375,15 +426,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -393,12 +444,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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 ) { @@ -410,8 +461,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs index 4af4b0e31d00..5d5f4d1b91da 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Get the specified role management policy for a resource scope @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the specified role management policy for a resource scope")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzRoleManagementPolicy_GetViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_GetViaIdentity : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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.Resources.Authorization.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 GetAzRoleManagementPolicy_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzRoleManagementPolicy_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +361,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -348,12 +399,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -370,7 +421,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -388,12 +439,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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 ) { @@ -405,8 +456,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs index 0d2414a09fb0..e1b73efff65b 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleManagementPolicy_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Gets role management policies for a resource scope. @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets /// [OpenAPI] ListForScope=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleManagementPolicy_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Gets role management policies for a resource scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies", ApiVersion = "2020-10-01-preview")] public partial class GetAzRoleManagementPolicy_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_List : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 GetAzRoleManagementPolicy_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -122,24 +143,24 @@ public partial class GetAzRoleManagementPolicy_List : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult /// 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) @@ -162,6 +183,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -183,7 +209,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzRoleManagementPolicy_List() { @@ -234,8 +260,33 @@ public GetAzRoleManagementPolicy_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -288,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -306,7 +357,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +395,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -366,15 +417,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope }) + 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 } }); @@ -384,12 +435,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult /// 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 ) { @@ -401,15 +452,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyListResult + 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/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs index e4ebc31ad4f3..7e74b4554b23 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Creates a role assignment schedule request. + /// create a role assignment schedule request. /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role assignment schedule request.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// 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; + /// Role Assignment schedule request - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleAssignmentScheduleRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -110,9 +128,12 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: ReadOnly = false, Description = @"Type of the role assignment schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type ExpirationType { get => _parametersBody.ExpirationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); set => _parametersBody.ExpirationType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -177,7 +198,7 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The principal ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] @@ -216,9 +237,9 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: ReadOnly = false, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => _parametersBody.RequestType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); set => _parametersBody.RequestType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } /// The role definition ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] @@ -312,24 +333,24 @@ public partial class NewAzRoleAssignmentScheduleRequest_CreateExpanded : global: /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -352,6 +373,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -416,8 +442,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -427,7 +478,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleAssignmentScheduleRequest_CreateExpanded() { @@ -481,7 +532,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -494,12 +545,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -535,12 +586,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.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest /// 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 ) { @@ -552,8 +603,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleAssignmentScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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; + } + } } } @@ -561,12 +630,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -583,15 +652,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..9e060c6f75ae --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role assignment schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleAssignmentScheduleRequest_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleAssignmentScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs new file mode 100644 index 000000000000..9e1c8c02bdfb --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleAssignmentScheduleRequest_CreateViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role assignment schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleAssignmentScheduleRequest_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleAssignmentScheduleRequest_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleAssignmentScheduleRequest_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleAssignmentScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs index 073aca1a8833..5edb6a0bb32a 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Creates a role eligibility schedule request. + /// create a role eligibility schedule request. /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Creates a role eligibility schedule request.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// 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; + /// Role Eligibility schedule request - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleEligibilityScheduleRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -110,9 +128,12 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global ReadOnly = false, Description = @"Type of the role eligibility schedule expiration", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type ExpirationType { get => _parametersBody.ExpirationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.Type)""); set => _parametersBody.ExpirationType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -166,7 +187,7 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The principal ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] @@ -205,9 +226,9 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global ReadOnly = false, Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", SerializedName = @"requestType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType RequestType { get => _parametersBody.RequestType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support.RequestType)""); set => _parametersBody.RequestType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } /// The role definition ID. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] @@ -301,24 +322,24 @@ public partial class NewAzRoleEligibilityScheduleRequest_CreateExpanded : global /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -341,6 +362,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -405,8 +431,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -416,7 +467,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleEligibilityScheduleRequest_CreateExpanded() { @@ -470,7 +521,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -483,12 +534,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -524,12 +575,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.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest /// 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 ) { @@ -541,8 +592,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleEligibilityScheduleRequest - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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; + } + } } } @@ -550,12 +619,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -572,15 +641,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..68151895415a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath.cs @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role eligibility schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleEligibilityScheduleRequest_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleEligibilityScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs new file mode 100644 index 000000000000..4c24fd1a5200 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleEligibilityScheduleRequest_CreateViaJsonString.cs @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role eligibility schedule request. + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleEligibilityScheduleRequest_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleEligibilityScheduleRequest_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleEligibilityScheduleRequest_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleEligibilityScheduleRequestsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs index bee7ab1754db..fbf504538863 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Create a role management policy assignment + /// create a role management policy assignment /// /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Create a role management policy assignment")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,14 +37,29 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// 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; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicyAssignment(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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] @@ -96,7 +117,7 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The policy id role management policy assignment. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] @@ -155,24 +176,24 @@ public partial class NewAzRoleManagementPolicyAssignment_CreateExpanded : global /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -195,6 +216,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -259,8 +285,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +321,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzRoleManagementPolicyAssignment_CreateExpanded() { @@ -324,7 +375,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,12 +388,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline); + await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,12 +429,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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment /// 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 ) { @@ -395,8 +446,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyAssignment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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; + } + } } } @@ -404,12 +473,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -426,15 +495,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..1b17d70163a8 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath.cs @@ -0,0 +1,505 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role management policy assignment + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleManagementPolicyAssignment_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPolicyAssignmentsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs new file mode 100644 index 000000000000..9229f2a2eb8c --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/NewAzRoleManagementPolicyAssignment_CreateViaJsonString.cs @@ -0,0 +1,503 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// create a role management policy assignment + /// + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzRoleManagementPolicyAssignment_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"create a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class NewAzRoleManagementPolicyAssignment_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 NewAzRoleManagementPolicyAssignment_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPolicyAssignmentsCreateViaJsonString(Scope, Name, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs index 2d9eb8741426..4152ad5c0be5 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy assignment @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class RemoveAzRoleManagementPolicyAssignment_Delete : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 +206,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -249,8 +275,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -337,7 +388,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicyAssignment_Delete() { @@ -370,12 +421,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ 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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -425,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -449,7 +500,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/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs index f838f72a512a..1d0511762c48 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy assignment @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity : /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -164,6 +185,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicyAssignment_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,7 +438,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -420,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); } @@ -444,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/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs index 4faac11068c0..b57cf258d1b7 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class RemoveAzRoleManagementPolicy_Delete : global::System.Manage /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 +206,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -249,8 +275,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -337,7 +388,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicy_Delete() { @@ -370,12 +421,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ 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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, 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 } }); @@ -425,7 +476,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -449,7 +500,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/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs index 59fed88e148f..4e3b2b4ba2e6 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/RemoveAzRoleManagementPolicy_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Delete a role management policy @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class RemoveAzRoleManagementPolicy_DeleteViaIdentity : global::Sy /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -164,6 +185,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,8 +254,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -285,7 +336,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -332,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzRoleManagementPolicy_DeleteViaIdentity() { @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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,7 +438,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -420,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); } @@ -444,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/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs index 6e642ad1b380..2ae2fa3b8490 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_Cancel.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role assignment schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class StopAzRoleAssignmentScheduleRequest_Cancel : 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -175,6 +196,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,8 +265,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleAssignmentScheduleRequest_Cancel() { @@ -360,12 +411,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -382,15 +433,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -415,7 +466,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/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs index 2507f19586db..df31430df8fc 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleAssignmentScheduleRequest_CancelViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role assignment schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class StopAzRoleAssignmentScheduleRequest_CancelViaIdentity : glo /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -154,6 +175,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +244,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleAssignmentScheduleRequest_CancelViaIdentity() { @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -410,7 +461,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/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs index 7774cb13db55..8e35e8255d07 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_Cancel.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role eligibility schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -137,12 +158,12 @@ public partial class StopAzRoleEligibilityScheduleRequest_Cancel : global::Syste /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -175,6 +196,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,8 +265,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleEligibilityScheduleRequest_Cancel() { @@ -360,12 +411,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -382,15 +433,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -415,7 +466,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/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs index 6a1e2f5173b0..a1db963b2e78 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/StopAzRoleEligibilityScheduleRequest_CancelViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; /// Cancels a pending role eligibility schedule request. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel", ApiVersion = "2020-10-01-preview")] public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class StopAzRoleEligibilityScheduleRequest_CancelViaIdentity : gl /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 @@ -154,6 +175,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,8 +244,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } }); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzRoleEligibilityScheduleRequest_CancelViaIdentity() { @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 } @@ -410,7 +461,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/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs new file mode 100644 index 000000000000..2866ab50eb19 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded.cs @@ -0,0 +1,737 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role assignment schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleAssignmentScheduleRequest_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role Assignment schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role assignment schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role assignment schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role assignment schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role assignment schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role assignment schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role assignment schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role assignment schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Justification for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role assignment", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// The linked role eligibility schedule id - to activate an eligibility. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The linked role eligibility schedule id - to activate an eligibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The linked role eligibility schedule id - to activate an eligibility.", + SerializedName = @"linkedRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string LinkedRoleEligibilityScheduleId { get => _parametersBody.LinkedRoleEligibilityScheduleId ?? null; set => _parametersBody.LinkedRoleEligibilityScheduleId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role assignment to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role assignment to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role assignment to create. It can be any valid GUID.", + SerializedName = @"roleAssignmentScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleAssignmentScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role assignment schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role assignment schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// The resultant role assignment schedule id or the role assignment schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role assignment schedule id or the role assignment schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", + SerializedName = @"targetRoleAssignmentScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleId { get => _parametersBody.TargetRoleAssignmentScheduleId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleId = value; } + + /// The role assignment schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role assignment schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role assignment schedule instance id being updated", + SerializedName = @"targetRoleAssignmentScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleInstanceId { get => _parametersBody.TargetRoleAssignmentScheduleInstanceId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleInstanceId = value; } + + /// Ticket number for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role assignment", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role assignment", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleAssignmentScheduleRequest_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleId"))) + { + this.TargetRoleAssignmentScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleInstanceId"))) + { + this.TargetRoleAssignmentScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedRoleEligibilityScheduleId"))) + { + this.LinkedRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["LinkedRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..7198f9485595 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded.cs @@ -0,0 +1,730 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role assignment schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role assignment schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role Assignment schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleAssignmentScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleAssignmentScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role assignment schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role assignment schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role assignment schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role assignment schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role assignment schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role assignment schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role assignment schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Justification for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role assignment", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// The linked role eligibility schedule id - to activate an eligibility. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The linked role eligibility schedule id - to activate an eligibility.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The linked role eligibility schedule id - to activate an eligibility.", + SerializedName = @"linkedRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string LinkedRoleEligibilityScheduleId { get => _parametersBody.LinkedRoleEligibilityScheduleId ?? null; set => _parametersBody.LinkedRoleEligibilityScheduleId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role assignment schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role assignment schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role assignment schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// + /// The resultant role assignment schedule id or the role assignment schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role assignment schedule id or the role assignment schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role assignment schedule id or the role assignment schedule id being updated", + SerializedName = @"targetRoleAssignmentScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleId { get => _parametersBody.TargetRoleAssignmentScheduleId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleId = value; } + + /// The role assignment schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role assignment schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role assignment schedule instance id being updated", + SerializedName = @"targetRoleAssignmentScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleAssignmentScheduleInstanceId { get => _parametersBody.TargetRoleAssignmentScheduleInstanceId ?? null; set => _parametersBody.TargetRoleAssignmentScheduleInstanceId = value; } + + /// Ticket number for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role assignment", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role assignment + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role assignment", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleAssignmentScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleAssignmentScheduleRequestName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleAssignmentScheduleRequestName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleAssignmentScheduleRequestsGetWithResult(InputObject.Scope ?? null, InputObject.RoleAssignmentScheduleRequestName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleAssignmentScheduleRequestsCreate(InputObject.Scope ?? null, InputObject.RoleAssignmentScheduleRequestName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleAssignmentScheduleRequest_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleId"))) + { + this.TargetRoleAssignmentScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleAssignmentScheduleInstanceId"))) + { + this.TargetRoleAssignmentScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleAssignmentScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedRoleEligibilityScheduleId"))) + { + this.LinkedRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["LinkedRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + /// 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.Resources.Authorization.Models.IRoleAssignmentScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs new file mode 100644 index 000000000000..84009d33562a --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded.cs @@ -0,0 +1,722 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role eligibility schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleEligibilityScheduleRequest_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role Eligibility schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role eligibility schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role eligibility schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role eligibility schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role eligibility schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role eligibility schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role eligibility schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role eligibility schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; } } + + /// Justification for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role eligibility", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the role eligibility to create. It can be any valid GUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the role eligibility to create. It can be any valid GUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the role eligibility to create. It can be any valid GUID.", + SerializedName = @"roleEligibilityScheduleRequestName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleEligibilityScheduleRequestName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role eligibility schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, + /// use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + /// for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + /// for a resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role eligibility schedule request to create. The scope can be any REST resource instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// + /// The resultant role eligibility schedule id or the role eligibility schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role eligibility schedule id or the role eligibility schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", + SerializedName = @"targetRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleId { get => _parametersBody.TargetRoleEligibilityScheduleId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleId = value; } + + /// The role eligibility schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role eligibility schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role eligibility schedule instance id being updated", + SerializedName = @"targetRoleEligibilityScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleInstanceId { get => _parametersBody.TargetRoleEligibilityScheduleInstanceId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleInstanceId = value; } + + /// Ticket number for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role eligibility", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role eligibility", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleEligibilityScheduleRequest_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleId"))) + { + this.TargetRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleInstanceId"))) + { + this.TargetRoleEligibilityScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..365685adfef4 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded.cs @@ -0,0 +1,715 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role eligibility schedule request. + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role eligibility schedule request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role Eligibility schedule request + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleEligibilityScheduleRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleEligibilityScheduleRequest(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; + + /// + /// The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + /// StringEqualsIgnoreCase 'foo_storage_container' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'", + SerializedName = @"condition", + PossibleTypes = new [] { typeof(string) })] + public string Condition { get => _parametersBody.Condition ?? null; set => _parametersBody.Condition = value; } + + /// Version of the condition. Currently accepted value is '2.0' + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Version of the condition. Currently accepted value is '2.0'")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Version of the condition. Currently accepted value is '2.0'", + SerializedName = @"conditionVersion", + PossibleTypes = new [] { typeof(string) })] + public string ConditionVersion { get => _parametersBody.ConditionVersion ?? null; set => _parametersBody.ConditionVersion = value; } + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Duration of the role eligibility schedule in TimeSpan. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Duration of the role eligibility schedule in TimeSpan.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Duration of the role eligibility schedule in TimeSpan.", + SerializedName = @"duration", + PossibleTypes = new [] { typeof(string) })] + public string ExpirationDuration { get => _parametersBody.ExpirationDuration ?? null; set => _parametersBody.ExpirationDuration = value; } + + /// End DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "End DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"End DateTime of the role eligibility schedule.", + SerializedName = @"endDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ExpirationEndDateTime { get => _parametersBody.ExpirationEndDateTime ?? default(global::System.DateTime); set => _parametersBody.ExpirationEndDateTime = value; } + + /// Type of the role eligibility schedule expiration + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the role eligibility schedule expiration")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the role eligibility schedule expiration", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AfterDuration", "AfterDateTime", "NoExpiration")] + public string ExpirationType { get => _parametersBody.ExpirationType ?? null; set => _parametersBody.ExpirationType = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Justification for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Justification for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Justification for the role eligibility", + SerializedName = @"justification", + PossibleTypes = new [] { typeof(string) })] + public string Justification { get => _parametersBody.Justification ?? null; set => _parametersBody.Justification = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The principal ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The principal ID.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + public string PrincipalId { get => _parametersBody.PrincipalId ?? null; set => _parametersBody.PrincipalId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.PSArgumentCompleterAttribute("AdminAssign", "AdminRemove", "AdminUpdate", "AdminExtend", "AdminRenew", "SelfActivate", "SelfDeactivate", "SelfExtend", "SelfRenew")] + public string RequestType { get => _parametersBody.RequestType ?? null; set => _parametersBody.RequestType = value; } + + /// The role definition ID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition ID.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Start DateTime of the role eligibility schedule. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Start DateTime of the role eligibility schedule.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start DateTime of the role eligibility schedule.", + SerializedName = @"startDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ScheduleInfoStartDateTime { get => _parametersBody.ScheduleInfoStartDateTime ?? default(global::System.DateTime); set => _parametersBody.ScheduleInfoStartDateTime = value; } + + /// + /// The resultant role eligibility schedule id or the role eligibility schedule id being updated + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resultant role eligibility schedule id or the role eligibility schedule id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resultant role eligibility schedule id or the role eligibility schedule id being updated", + SerializedName = @"targetRoleEligibilityScheduleId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleId { get => _parametersBody.TargetRoleEligibilityScheduleId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleId = value; } + + /// The role eligibility schedule instance id being updated + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role eligibility schedule instance id being updated")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role eligibility schedule instance id being updated", + SerializedName = @"targetRoleEligibilityScheduleInstanceId", + PossibleTypes = new [] { typeof(string) })] + public string TargetRoleEligibilityScheduleInstanceId { get => _parametersBody.TargetRoleEligibilityScheduleInstanceId ?? null; set => _parametersBody.TargetRoleEligibilityScheduleInstanceId = value; } + + /// Ticket number for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket number for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket number for the role eligibility", + SerializedName = @"ticketNumber", + PossibleTypes = new [] { typeof(string) })] + public string TicketNumber { get => _parametersBody.TicketInfoTicketNumber ?? null; set => _parametersBody.TicketInfoTicketNumber = value; } + + /// Ticket system name for the role eligibility + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Ticket system name for the role eligibility")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ticket system name for the role eligibility", + SerializedName = @"ticketSystem", + PossibleTypes = new [] { typeof(string) })] + public string TicketSystem { get => _parametersBody.TicketInfoTicketSystem ?? null; set => _parametersBody.TicketInfoTicketSystem = 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleEligibilityScheduleRequestsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleEligibilityScheduleRequestName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleEligibilityScheduleRequestName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleEligibilityScheduleRequestsGetWithResult(InputObject.Scope ?? null, InputObject.RoleEligibilityScheduleRequestName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleEligibilityScheduleRequestsCreate(InputObject.Scope ?? null, InputObject.RoleEligibilityScheduleRequestName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleEligibilityScheduleRequest_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RequestType"))) + { + this.RequestType = (string)(this.MyInvocation?.BoundParameters["RequestType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PrincipalId"))) + { + this.PrincipalId = (string)(this.MyInvocation?.BoundParameters["PrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleId"))) + { + this.TargetRoleEligibilityScheduleId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TargetRoleEligibilityScheduleInstanceId"))) + { + this.TargetRoleEligibilityScheduleInstanceId = (string)(this.MyInvocation?.BoundParameters["TargetRoleEligibilityScheduleInstanceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Justification"))) + { + this.Justification = (string)(this.MyInvocation?.BoundParameters["Justification"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Condition"))) + { + this.Condition = (string)(this.MyInvocation?.BoundParameters["Condition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ConditionVersion"))) + { + this.ConditionVersion = (string)(this.MyInvocation?.BoundParameters["ConditionVersion"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScheduleInfoStartDateTime"))) + { + this.ScheduleInfoStartDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ScheduleInfoStartDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationType"))) + { + this.ExpirationType = (string)(this.MyInvocation?.BoundParameters["ExpirationType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketNumber"))) + { + this.TicketNumber = (string)(this.MyInvocation?.BoundParameters["TicketNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TicketSystem"))) + { + this.TicketSystem = (string)(this.MyInvocation?.BoundParameters["TicketSystem"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationEndDateTime"))) + { + this.ExpirationEndDateTime = (global::System.DateTime)(this.MyInvocation?.BoundParameters["ExpirationEndDateTime"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpirationDuration"))) + { + this.ExpirationDuration = (string)(this.MyInvocation?.BoundParameters["ExpirationDuration"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + /// 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.Resources.Authorization.Models.IRoleEligibilityScheduleRequest + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs new file mode 100644 index 000000000000..a05ec86fbdc5 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateExpanded.cs @@ -0,0 +1,528 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy assignment + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicyAssignment_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleManagementPolicyAssignment_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role management policy + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of format {guid_guid} the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of format {guid_guid} the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of format {guid_guid} the role management policy assignment to upsert.", + SerializedName = @"roleManagementPolicyAssignmentName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyAssignmentName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The policy id role management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The policy id role management policy assignment.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + public string PolicyId { get => _parametersBody.PolicyId ?? null; set => _parametersBody.PolicyId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The role definition of management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition of management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition of management policy assignment.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = value; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy assignment to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy assignment to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy assignment to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetWithResult(Scope, Name, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreate(Scope, Name, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicyAssignment_UpdateExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PolicyId"))) + { + this.PolicyId = (string)(this.MyInvocation?.BoundParameters["PolicyId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..513f62ffcca3 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded.cs @@ -0,0 +1,526 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy assignment + /// + /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// [OpenAPI] Create=>PUT:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy assignment")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + public partial class UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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; + + /// Role management policy + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyAssignment _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicyAssignment(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + + /// The policy id role management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The policy id role management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The policy id role management policy assignment.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + public string PolicyId { get => _parametersBody.PolicyId ?? null; set => _parametersBody.PolicyId = value; } + + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The role definition of management policy assignment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The role definition of management policy assignment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The role definition of management policy assignment.", + SerializedName = @"roleDefinitionId", + PossibleTypes = new [] { typeof(string) })] + public string RoleDefinitionId { get => _parametersBody.RoleDefinitionId ?? null; set => _parametersBody.RoleDefinitionId = 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.ICloudError + /// 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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPolicyAssignmentsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreateViaIdentity(InputObject.Id, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.Scope) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.RoleManagementPolicyAssignmentName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleManagementPolicyAssignmentName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _parametersBody = await this.Client.RoleManagementPolicyAssignmentsGetWithResult(InputObject.Scope ?? null, InputObject.RoleManagementPolicyAssignmentName ?? null, this, Pipeline); + this.Update_parametersBody(); + await this.Client.RoleManagementPolicyAssignmentsCreate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyAssignmentName ?? null, _parametersBody, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzRoleManagementPolicyAssignment_UpdateViaIdentityExpanded() + { + + } + + private void Update_parametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RoleDefinitionId"))) + { + this.RoleDefinitionId = (string)(this.MyInvocation?.BoundParameters["RoleDefinitionId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PolicyId"))) + { + this.PolicyId = (string)(this.MyInvocation?.BoundParameters["PolicyId"]); + } + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + /// 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.Resources.Authorization.Models.IRoleManagementPolicyAssignment + 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs index fb44d6f00cf1..14a1431f4f3c 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Update a role management policy + /// update a role management policy /// /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// 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; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -78,6 +96,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -130,7 +151,7 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -157,9 +178,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste ReadOnly = false, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ParameterBreakingChange("Rule", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule ?? null /* arrayOf */; set => _parametersBody.Rule = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Rule = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _scope; @@ -180,24 +201,24 @@ public partial class UpdateAzRoleManagementPolicy_UpdateExpanded : global::Syste /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) @@ -220,6 +241,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -284,8 +310,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +392,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -354,12 +405,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RoleManagementPoliciesUpdate(Scope, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdate(Scope, Name, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzRoleManagementPolicy_UpdateExpanded() { @@ -405,12 +456,12 @@ public UpdateAzRoleManagementPolicy_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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -427,15 +478,15 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope, Name=Name, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Scope=Scope, Name=Name, body=_parametersBody }) + 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 } }); @@ -445,12 +496,12 @@ public UpdateAzRoleManagementPolicy_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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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 ) { @@ -462,8 +513,26 @@ public UpdateAzRoleManagementPolicy_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + 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/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs index 4400bb2da50c..bf5ae2d3c3bd 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Update a role management policy + /// update a role management policy /// /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties=new string[] {"List[EffectiveRule]","List[Rule]"})] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Update a role management policy")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,14 +38,29 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl /// 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; + /// Role management policy - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.RoleManagementPolicy(); + private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.RoleManagementPolicy(); + + /// + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -78,6 +96,9 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _parametersBody.DisplayName ?? null; set => _parametersBody.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -123,7 +144,7 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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")] @@ -150,33 +171,33 @@ public partial class UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded : gl ReadOnly = false, Description = @"The rule applied to the policy.", SerializedName = @"rules", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule) })] + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule) })] [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.ParameterBreakingChange("Rule", "15.0.0", "9.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule ?? null /* arrayOf */; set => _parametersBody.Rule = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicyRule[] Rule { get => _parametersBody.Rule?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.Rule = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) @@ -199,6 +220,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -263,8 +289,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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -320,7 +371,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +386,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.RoleManagementPoliciesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); } else { @@ -348,13 +399,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RoleManagementPolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.RoleManagementPoliciesUpdate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RoleManagementPoliciesUpdate(InputObject.Scope ?? null, InputObject.RoleManagementPolicyName ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + 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 } }); @@ -374,7 +425,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() { @@ -400,12 +451,12 @@ public UpdateAzRoleManagementPolicy_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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -422,15 +473,15 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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=_parametersBody }) + 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 } }); @@ -440,12 +491,12 @@ public UpdateAzRoleManagementPolicy_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.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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 ) { @@ -457,8 +508,26 @@ public UpdateAzRoleManagementPolicy_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IRoleManagementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + 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/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..0dfd7124bdb6 --- /dev/null +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath.cs @@ -0,0 +1,506 @@ +// 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.Resources.Authorization.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; + using System; + + /// update a role management policy + /// + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name (guid) of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name (guid) of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name (guid) of the role management policy to upsert.", + SerializedName = @"roleManagementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.Models.IRoleManagementPolicy + /// 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.Resources.Authorization.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RoleManagementPoliciesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RoleManagementPoliciesUpdateViaJsonString(Scope, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicy_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Models.ICloudError + /// 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.Resources.Authorization.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.Resources.Authorization.Models.IRoleManagementPolicy + /// 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.Resources.Authorization.Models.IRoleManagementPolicy + 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/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs similarity index 74% rename from generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs rename to generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs index 9231d862203d..d779f53cbbc9 100644 --- a/generated/Resources/Authorization.Autorest/generated/cmdlets/GetAzRoleEligibleChildResource_GetViaIdentity.cs +++ b/generated/Resources/Authorization.Autorest/generated/cmdlets/UpdateAzRoleManagementPolicy_UpdateViaJsonString.cs @@ -6,19 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Cmdlets; using System; - /// Get the child resources of a resource on which user has eligible access + /// update a role management policy /// - /// [OpenAPI] Get=>GET:"/{scope}/providers/Microsoft.Authorization/eligibleChildResources" + /// [OpenAPI] Update=>PATCH:"/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzRoleEligibleChildResource_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"Get the child resources of a resource on which user has eligible access")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzRoleManagementPolicy_UpdateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy", "15.0.0", "9.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"EffectiveRule[]","Rule[]"}, NewOutputProperties = new string[] {"List[EffectiveRule]","List[Rule]" } )] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Description(@"update a role management policy")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/eligibleChildResources", ApiVersion = "2020-10-01-preview")] - public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.HttpPath(Path = "/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}", ApiVersion = "2020-10-01-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.NotSuggestDefaultParameterSet] + public partial class UpdateAzRoleManagementPolicy_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +39,26 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// A flag to tell whether it is the first onOK call. - private bool _isFirst = true; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Link to retrieve next page. - private string _nextLink; + /// 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.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources.Authorization.Authorization Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.ClientAPI; @@ -58,23 +72,8 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - /// Backing field for property. - private string _filter; - - /// - /// The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = - /// 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of - /// type = 'Subscription' or 'ResourceGroup' - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = 'Subscription' or 'ResourceGroup'", - SerializedName = @"$filter", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Query)] - public string Filter { get => this._filter; set => this._filter = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -88,17 +87,22 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IAuthorizationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// 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.Resources.Authorization.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. /// @@ -107,10 +111,25 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name (guid) of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name (guid) of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name (guid) of the role management policy to upsert.", + SerializedName = @"roleManagementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RoleManagementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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,29 +147,43 @@ public partial class GetAzRoleEligibleChildResource_GetViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _scope; + + /// The scope of the role management policy to upsert. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The scope of the role management policy to upsert.")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The scope of the role management policy to upsert.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.ParameterCategory.Path)] + public string Scope { get => this._scope; set => this._scope = 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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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) @@ -173,6 +206,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.Resources.Authorization.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -193,14 +231,6 @@ protected override void EndProcessing() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public GetAzRoleEligibleChildResource_GetViaIdentity() - { - - } - /// 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 @@ -245,8 +275,33 @@ public GetAzRoleEligibleChildResource_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.Resources.Authorization.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.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -263,9 +318,12 @@ protected override void ProcessRecord() try { // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + if (ShouldProcess($"Call remote 'RoleManagementPoliciesUpdate' operation")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token); + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token); + } } } catch (global::System.AggregateException aggregateException) @@ -299,7 +357,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,24 +370,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.EligibleChildResourcesGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.Scope) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Scope"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.EligibleChildResourcesGet(InputObject.Scope ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); - } + await this.Client.RoleManagementPoliciesUpdateViaJsonString(Scope, Name, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Scope=Scope,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,6 +394,14 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzRoleManagementPolicy_UpdateViaJsonString() + { + + } + /// new protected void WriteObject(object sendToPipeline) { @@ -367,12 +421,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.Resources.Authorization.Models.Api20201001Preview.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.ICloudError /// 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 ) { @@ -389,15 +443,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.Resources.Authorization.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + 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 } }); @@ -407,12 +461,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.Resources.Authorization.Models.Api20201001Preview.IEligibleChildResourcesListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy /// 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 ) { @@ -424,22 +478,24 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // response should be returning an array of some kind. +Pageable - // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); - _nextLink = result.NextLink; - if (_isFirst) + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Models.IRoleManagementPolicy + var result = (await response); + if (null != result) { - _isFirst = false; - while (_nextLink != null) + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else { - if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + if (1 ==_responseSize) { - requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.EligibleChildResourcesGet_Call(requestMessage, onOk, onDefault, this, Pipeline); + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; } } } diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..453e951f6e6c --- /dev/null +++ b/generated/Resources/Authorization.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.Resources.Authorization +{ + 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/Resources/Authorization.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..a9819bbe1a6e --- /dev/null +++ b/generated/Resources/Authorization.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.Resources.Authorization +{ + 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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 24d4f23cf8fb..3a353119ca3b 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Resources/Authorization.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.Resources.Authorization.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @""; 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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index e3b1afe81a28..dac8b25410fe 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Resources/Authorization.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.Resources.Authorization.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index fc2ea9393295..a47bdcb7f46a 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 3264ce9f6528..d6e382a38bde 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index b16aadc27e13..99e0539e3456 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 45528ca3696a..f0dc18286296 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index ec6828166bea..2050461f6889 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 88448e9091da..4ee1a8a35ba8 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index dbb0492d8459..7f2cac3673cb 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 817ee915f71d..fb3a2a4a76fd 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"Az.Resources";} + public string RootModuleName { get => @"Az.Resources"; } 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/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs index d169c03237d1..46e91cf21015 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 856787d73ad4..2d5f9616a1dc 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.Runtime.Pow { 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/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs index be42fa53654b..55ae86fdc1ab 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/Context.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..7df957279168 --- /dev/null +++ b/generated/Resources/Authorization.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.Resources.Authorization.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.Resources.Authorization.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.Resources.Authorization.Authorization Client { get; } + } +} diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs index 53511eb8fcdb..ffb09099d75e 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Events.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs b/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs index c9a8cd7d7170..f51181658781 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs index d6e90efdf6be..8f54d4d26e97 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/InputHandler.cs b/generated/Resources/Authorization.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..049fbeec84ac --- /dev/null +++ b/generated/Resources/Authorization.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.Resources.Authorization.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.Resources.Authorization.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs b/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs index 153975a55117..999114d25e51 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Resources/Authorization.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.Authorization.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.Resources") ? @"Az.Authorization" : @"Az.Resources"; + //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/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index b326c0e17bb6..a5e5a21e9c3f 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx b/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs b/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs index 81d1bc78b427..86e27bbc3f1d 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs index b00810c9b058..af4102d84ea9 100644 --- a/generated/Resources/Authorization.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Resources/Authorization.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/Resources/Authorization.Autorest/test-module.ps1 b/generated/Resources/Authorization.Autorest/test-module.ps1 index 2b747f6f7d2e..6bb3fe29276a 100644 --- a/generated/Resources/Authorization.Autorest/test-module.ps1 +++ b/generated/Resources/Authorization.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-------------'